It depends where you live. Right now, there are 63 countries where smacking children is illegal. Sweden was the first country to ban smacking in 1979. In the United Kingdom, it is only legal in England and Northern Ireland. In the US, it is legal across all states. Some states have banned corporal punishment but only in schools.
You can find more about this topic in this article: Is Smacking Your Child Ever OK?
Love,
Ana