Well we had corporal punishment at the school I went to. The head master and even the head/deputy head boy were allowed to cane students across their backsides. I remember one term when I received 54 strokes in total. I got wise to it in the end and if I was to be caned by the head boy, I'd refuse to bend over. All he could do was send you to the head master for refusing and you'd then get the cane from him instead.
Cane from the head master used to hurt but not as badly as from the head boy. The head master would tell you to bend over the back of a chair, then he'd check there was nothing inside your pants, stretch your pants across your cheeks and then whack you - usually six strokes for most things.
Cane from the head boy was something else. He would tell you to bend over and touch your toes. He would rest the can on your cheeks so you knew what was coming, the he'd take a run from the other side of the room and whack so hard it was hard not to cry out and sometimes even lose your balance. There was such a long wait for the next one as he walked back to the other side of the room ready to take another run and swipe at you - and again - and again - and again - always 6 from him.
Next was back to class to drop your pants down so all your mates could see the raised red and blue whelts across your cheeks, and next the day or two after when they turned to black and yellow bruises.
I don't think it curbed my bad behaviour at school though.
I'm assuming children in school. I would think yes. A good paddling can leave a memory that unsatisfactory behavior can lead to some painful humiliation as a consequence.
Now we are facing generations of folks who do not fear or respect the law.