But it's unaccepable to hit them around the head. A child of 2 or 3 is still learning and you cannot really reason with them. The poor child probably couldn't understand why it was assaulted and hurt like this.
Few people would tolerate seeing someone beat a defenceless dog, so why let it happen to a small, defenceless child. A smack on the hand or leg, is completely different to a hefty wack around the head.
If this had gone up to someone else in the supermarket and hit them around the head, he would be up on assault charges.