We have a daughter - same exact age, same exact situation. The good news is that she's clearly not doing it out of anger, she just slaps us on the face from time to time and you can tell by looking at HER face that she's wondering what our reaction will be. Curiosity. Sometimes, she even immediately hugs us as if she knows that it's wrong and that she's sorry. BUT - from everything I've read and from what our pediatrician told us, we should NOT hit back. Shows them the behavior is acceptable. I agree with the moms who commented that not giving them a response at all is a good plan. We do that, plus, we put her in time out as SOON as she does it. We don't respond to her, pick her up and take her to the pack-n-play that we have set up for time out only. Once we get her in there we tell her "We don't hit, hitting hurts, now you need to stay in time out."
She definitely "gets" that this is a punishment for her actions. She "gets" that it's wrong. Doesn't mean she stopped after the first time out, but it's gotten better. Our pediatrician says that time out should be: a minute for every year of their age. So at this stage - 2 minutes tops.
When we get her out of time out we calmly explain again why it was wrong and we ask her to tell us she's sorry. She does, hugs and kisses us, and runs on to play.