Very valid point. However, I know my home city well enough to avoid this and when I travel I generally have no need to walk anywhere outside of the main tourist spots; I am not much of an "urban explorer". Not that all tourist areas are safe, but by and large they are safer areas of town for the most part.
Most people probably know their home towns well enough to stay safe, as long as they pay attention. But then so many people play with the "I should be able to..." mentality and put their personal safety at risk in the process.
Many years ago I lived in a town where there was a spate of attacks on young women late at night. They were very regular - before the police caught the culprit I think he raped two women and attacked another two in the space of a week or so (of the two "attacks" I think at least one of the victims escaped). Yet you'd still see young women walking alone, after dark, in the area a rapist was known to be operating, oblivious to their surroundings.
Some years later I lived in another area not far from where several people were attacked by an assailant with a hammer. From what I recall he basically approached people from behind and hit them with the hammer. I think his motives were robbery rather than rape although most of his victims were women. And yet time and time again you'd see young women walking alone with a hood up and headphones playing music loudly enough you could hear it from 20 feet away.
I still remember what a former karate instructor of mine stressed to our class. At the time I was about a green belt and she was a 2nd dan black belt. By any metric she'd absolutely thrash me in a sparring match. But as she said in a street fight there are no rules and, since I was easily twice her size, all I'd need to do is land one good strike and it's pretty much game over for her.
To quote Mr Miyagi, sometimes the best defence is "no be there".