I race Alaskan Malamute sled dogs along side of MTBing and have experience of rehoming poorly trained/ aggresive dogs as well as having done work for the dog charities, my day job is in law enforcment too so I can answer a few queries here.
Stungun- Don't even think about it, classed as a fire arm and illeagal.
Ditto Mace/Pepper spray or anything intentionally made and/or carried for the same purpose.
Amonia- yes the hormone affect mentioned earlier will case a dog to back off, but I have had a very good result from a water pistol filled with lemon juice & a bit of water- squirt this in/at the open mouth and they stop dead- all the saliva disolves in their mouth and has a simlar affect as being kicked in the nuts mid coitas- takes away all performance and desire.
A sudden shot of any cold liquid will sober or stun most animals enough for a get away though.
There are holds that prompt a dog to back down. It regresses the dog to it's puppy stage as it mimicks the mothers way of controlling them but I wouldn't recomend trying this if you don't know what you're doing.
Best way to passify a dog is to turn sideways, lower your eyes bellow that of the dog and look up at it- this is dog talk for "OK You're the boss"
If a dog is biting on you or something you need back like a bag or bike put your hand over the top of the snout and push it's lips under it's teeth, it will realease it's jaws as it will be biting itself.
If you REALLY need to fight a dog off or else it will KILL you, push (from below) or pull (from above/behind) the dogs front legs apart, this will kill the dog dead due to lacerated internal organs and disslocated legs.