Don'ts are not very helpful. When your young child wants to interact with the dog, make a noise, get your attention, what ever, she really can not think of any other way to get her need or want met and "Don't hit the dog" only reinforces the one way she can think of. When I say to you don't think of a orange ball, Can you do it? Or does an orange ball come to mind?
What she needs is lots of options for meeting her needs.
"You would like to play with the dog? She likes it when you scratch her ears/roll the ball/pet her back."
"You are angry? You can pound the peg board with this hammer/squish the playdough in your fingers/go on the porch and scream."
For the gorcery store, I would keep in mind some games. I spy something orange/cold/in the air/the letter M. Sometimes counting can be fun-fingers or oranges or buttons on the credit card thing. Stickers are always a last resort thing I try to keep in my purse. Eating something that you have bought, including letting her try to get the package open can give you a few more minutes.