Recognize Body Language
To prevent encounters with aggressive dogs, you should learn how to recognize signs of aggression. This is really important for me, because Odin always wants to immediately play with another dog, but that other dog doesn't necessarily want to play with him. I have to deliberately pace Odin's greeting and make sure he doesn't get too playful at initial encounter.
During that greeting, I am always aware of the other dog's body language. Before a dog outright growls or snarls, he usually displays cautious movements and offers others a look that seems to say 'stay away.' The dog may also cower near his owner or look scared, which can lead to defensive, fear aggressive behavior.
When we encounter a dog like this, I use the leash to guide Odin back and make him sit by my side. Before allowing Odin to initiate greeting with another dog, I always ask the other dog's owner if that dog is friendly and playful.
Know Your Own Dog
Each dog will react differently towards aggressive animals. Some dogs will lunge at dogs who show aggression; others will become confused. Odin is the latter type of dog. He prefers to defend me, but sometimes he'll look up at me and yelp in confusion if an aggressive dog is near. This happens frequently when the aggressive dog is behind a fence. Because we are not in immediate danger, I take the time to show my dog that I'm the leader, walking confidently past the gated animal. Sometimes Odin will follow my lead and adapt the same demeanor; other times he still freaks out a bit. When this happens, I calmly and assertively tug at his collar until he follows along, eyes ahead instead of looking at the aggressive animal we've passed.
Preventing an Encounter
Sometimes, you will have the opportunity to avoid an aggressive dog. If this is the case, take the opportunity. There is no reason you should risk the safety of yourself, your dog, or the other dog. In our old neighborhood, there lived two aggressive dogs. When walking Odin, I simply turned around or walked on the other side of the street to avoid provoking the aggressive dogs. This also reinforced the fact that I was the leader and in charge of the walk, and after switching things up a few times, I noticed Odin more easily adapted my calm attitude and seemed to trust my judgment more on walks.
In the event of an aggressive dog attack, protect yourself first. Call 9-1-1, try to remain calm, and do not turn your back on the aggressive dog. Avoid making eye contact with the attacking dog and do not show it your teeth - that includes smiling. Avoid yelling at the dog or punching back. If taken to the ground, curl up, ball your fists, and use your arms to cover your head until help arrives.
Unfortunately, not all aggressive dog encounters are preventable. We used to live next door to a family that owned an aggressive dog. While we had a fence between our yards, their dog would still bark and snarl. To avoid fights and to keep the noise level down for our other neighbors, we would arrange a schedule with the neighbors to ensure that neither dog was out in the fenced-in yard while the other was present.
If you ever encounter an unleashed dog (aggressive or not), you should contact your local animal control center to prevent injury to people and animals. You can also access immediate assistance through your local police department.