Being honest, this is 100% in big cities, but in the countryside it doesn't hold. A lot of cities between 100k-300k are pretty safe to live, people with gates leaves them open, even leave their cars entire open while getting a beer inside the house (all unlocked).
Comparing Brazil with Mexico with Madrid with Tokyo and coming to the conclusion that "is all the same" seems farfetched.
Policies that see "the poor" as the problem instead "poverty" create violent dystopian cities. Good policy works and make big cities great places to live. Reducing inequality, giving good safety nets to citizens, treating drug addiction as a disease, etc. make a difference. Not 100% of big cities are the same.
I am not American, so I could be wrong, but is San Francisco a good example of a city with low inequality? My understanding is that the opposite is true.
Most of the 50 most violent cities in Brazil aren't even the biggest in their State. The top 3 are all between 100 thousand and 150 thousand inhabitants. They all have homicide rates that are 2x to 4x as much as the national average. By comparison, São Paulo and Rio de Janeiro are much, much safer.
This list does not have the latest data from Brazilian cities. The Brazilian list I linked has dozens of Brazilian cities with a homicide rate of around 80 per 100.000.