If grandma is giving the gift as a graduation gift, period, then it would be fine.
If grandma is giving the gift really because grandma feels bad that granddaughter was called out on a disciplinary infraction, and grandma is as you put it "petting her" over it -- then it would not be fine.
Is grandma openly and clearly tying the gift to the "poor you, you should be a speaker" situation, or is grandma saying to granddaughter only, "This is for graduation and three years of great work"?
If grandma has NOT yet tied the gift to the infraction in front of your daughter, then I'd talk to grandma about not doing so, and let her give a well-earned graduation gift; if grandma has indeed told your daughter that the gift is because grandma's sorry for her because she got caught disobeying....then tell grandma that's not going to happen, because a gift for that reason sends totally the wrong message.
If the issue is really that you don't like hair extensions -- that's totally separate from the issue of the disciplinary infraction and should involve a talk between you and your daughter.
I would talk to your daughter about the "it doesn't apply to me" part of the incident at school, though. (I bet you already have!) If it persisted, that attitude could get her into more serious trouble in the years to come, even though she's clearly a good kid.