When I was young, my mother used to have me in a harness (I would never call it a leash).
And she had good reason to. In the supermarket I would run away from her and cause problems for other shoppers. I got so good at it, that I would place items from the bottom shelf on the floor so that she would have to slow down to put them back (lest they trip up other people).
There is no right or wrong here - there are shades of grey.
Treating your child as a dog = bad.
Trying to control your child so that they understand that they shouldn't inconvenience others = good.
Parents are just trying to do the best job they know how.
For my mother, it wasn't about me hurting myself - it was about me inconveniencing others.