To spank or not to spank?
It's probably the biggest parenting debate and has been so for years. First, a swat or two every once in a while, is not going to turn your kid into the next Hannibal Lector. There are some things you need to consider. That's why I think the bigger question, instead of, "Is it okay?" Instead, flip it and say, "Is it the right kind of discipline you should be using for your child?"
Sixty years of research has said, be careful. Spanking can contribute to up to ten different kinds of negative behaviors in our kids. Number one, it teaches our children to really act right for fear, instead of why they should be acting right. Number two, it has been shown to reduce our children's empathy and moral development. Number three, it actually stops behavior, but only temporarily. Usually the behavior that we are trying to get rid of comes back and resurfaces because a child doesn't know a replacer behavior.
Most importantly, it can really squelsh your relationship with your child. It is a tough parent that can spank without anger or frustration. Therefore, if you use spanking a lot and it's your only source, or number two, that your own relationship with your child is starting to dwindle or you can't hold it together. I strongly recommend you look to timeout or the use of consequences or another parenting disciplining approach is far healthier and far better for your child.