I picked a flower and my grandma yanked hard on a lock of my hair
Ouch, that must've hurt. Why did your grandmother yank on your hair?
She did that because I picked her flower without asking
That was an extreme response for sure. It is best that you not touch other people's things if they do not give you permission.
It's my grandma and I think it's okay to do what ever I want.
It's not okay to do whatever you want. Some people will get upset like your grandma if you continue this behavior.