Instead of: Don't you dare hit!
Try this: It's OK to be angry, but I won't let you hit. We need to keep everyone safe.
This gets the message firmly across that the emotion is okay, but the action is not. Separating the two will help your child learn to do likewise.