@dabes115
Sure, it'll teach them something, but it won't be the right thing. If I were to physically punish my kid for doing something dangerous, they'd avoid doing it because they don't want to get punished again, rather than avoiding it due to the dangers. They can also receive trauma from physical punishments, negatively changing the way they think.
The way you teach a kid a lesson should be dependent on who they are. Some kids only need to be told, some kids need to be shown, etc. As part as being a teacher or parent, you have to find out how to teach certain kids something without resorting to violence. I believe this applies to any adult when it comes to dealing with children.
p.s
You also shouldn't enforce beliefs onto a kid. A good example are my parents. My mom left it up to me whether I believed in God or not. My dad and I aren't Catholic, yet my mom is. We respect each other's opinions, and don't bother one another about it.
Letting your kid decide what they believe in or not will help them form their own opinions and find out more of themselves. Of course, certain things need to be taught but that is whether they are beliefs or common sense.