It's true, and there are a lot of different reasons for it. Some people have an irrational phobia, they're afraid of dogs like tons of people are afraid of spiders. You know, you're way bigger than it, you're a safe distance from it, but it still gives you the creeps or maybe makes you want to flee screaming. Dogs make some people feel that way, and there's no good reason for it, but they don't want dogs touching them the same way you don't want a tarantula or an orb weaver touching you.
You can understand how this person feels by picturing the dog as a giant spider. This is one reason why it is polite to not let your dog approach strangers uninvited.
Some people have movement disorders like cerebral palsy and Huntington's disease. The way these people move often creeps dogs out, even really friendly dogs that never act aggressive. Many people with movement disorders are afraid of dogs because they have been by normally nice dogs.
Some dogs are fine with everybody, and some have been specifically and deliberately trained that people that move in unusual ways aren't scary, but most dogs don't have a whole lot of experience in this area and find it kind of horrifying. The problem is that scared dogs do scary things like bite, lunge, and bark. Sometimes you can tell that someone has a movement disorder because they are equipped with a cane, crutches, a walker, or a wheelchair. Sometimes you can't tell until they take a step and your dog suddenly freaks out because it's seeing this:
It's polite to keep your dog on a leash because just seeing an unleashed dog can ruin this person's whole day without you ever knowing it.
For someone with a movement disorder, a leash means the difference between a safe dog and a dangerous dog.
Likewise, plenty of people are afraid of dogs simply because they've been attacked before.
There's a good chance the dog that bit them was supposedly friendly, and that dog's owner probably said it had never done anything like that before.

People who are afraid of dogs are everywhere. We dog owners can avoid scaring them by keeping our dogs on leashes and not letting them get into anyone's personal space in public. It's a good idea, because people who are afraid of dogs might be landlords, politicians, city council members, and other people who can actively make life easier or more difficult for dog owners. Think of it like scooping poop: when a few people don't do it, it makes all of us look bad and it makes non-dog owners want to make rules and ordinances banning dogs from places. Likewise, seeing a dog owner break a leash law can make a person who is afraid of dogs feel that way. Let's stick together and make dog owners as a group look good by keeping all of them on leashes, even small, friendly, harmless, elderly, and young ones. I can promise that the people who are afraid of dogs don't visit off-leash areas.