I never hit my dogs.
A loud voice and an upraised hand has perfect effect, without hurting your hand, or your dog.
Hurting your dog is counterproductive.
Good. I always used voice coupled with a hand clap to train mine.
People who beat their dogs to "teach them who is boss" are just setting themselves up for being attacked.