Street Photography is not a crime: not here in Mexico, not in Italy and not in the US and the most of democratic countries.
To put the hands on a person you don’t know, especially from behind: that is a crime!
I offered to police in Mexico to give a conference for free explaining about the rights of people to photograph in public places, including to photograph people without asking permission.
As a photographer I ask permission when I want a portrait of the person.
I don’t ask permission if I want a spontaneous moment.
When I ask permission people acts different from the spontaneous moment and street photography is about spontaneous moments, the real emotions when they are not aware of a camera.
Stay safe and keep shooting!
I’m sorry this happened to you, Alex. For me, it’s lost battle. It’s no illegal, but specially in Mexico, and specially in Centro Histórico (I guess this is where happened), people is so fearful of pictures and being ignorants, you always will lose no matter how right you are. That’s my eternal concern with street photography.
It may be legal, but a lot of humans don't like being photographed. Add a bit of mental illness, a touch of paranoia, and perhaps a chemical stimulant, and voila! You got yourself a problem! Happy for you that you were not hurt. It can be frightening to experience.