Joking aside, this is a real issue for anyone enjoying the outdoors, and the answers are out there on dog specific websites.
Dogs ARE aggressive by nature. There is a context to the aggression, and where a dog is behaving aggressively outside that context there is a problem the keeper needs to deal with, and we should know how to react to.
Generalising is of no real use.
You cannot predict the behaviour of people you meet, regardless of whether they have dogs with them or not.
There is no real fits all answer to how to deal with a dog intent on chasing or attacking you. You need a range of approaches to use according to what happens.
Sometimes shouting at a dog is effective, sometimes being super assertive. Calm quiet backing off, removing yourself from the dog's perceived territory is often the best answer. You don't have time to deal with 'bad' dog keepers every time you encounter their dogs.
As a keeper you should make sure your dog does not react to raised voices or low level aggression with an attack.
It is no use keeping a dog that will attack a drunk teen giving you some attitude down by the canal.
Just the other night I faced this. Not a teen, but a thirty odd year old dude who had downed a bottle of Vodka and seemed intent on drinking another whilst balanced precariously on the end of the pier.
I asked him to move to a picnic table away from the water, and he ended up reacting very aggressively.
Neither of my dogs reacted. Only if I had shown fear and agitation would they have become defensive.
Of course if he had shown aggression to them they would have run to me for protection rather than attacking him, unless cornered like most dogs.
I went to do my shopping and when I came back said dude was being questioned by the fuzz, and then was taken away in an ambulance.
Dogs should take their cue from their keepers. If they are remiss, we have to deal with them.
Shouldn't happen, but this is the real world.
A wee tap on the nose will not hurt a dog, and neither will a wee nip. The reason it often works is it distracts a dog, rather than inflicting pain.
You have to have all the tools in your arsenal when dealing with dogs, just as you need when handling people.