I used to deal with a MAJOR amount of loose dogs when I grew up on Guam(yes the tropical island). The worst offenders were policemen who would let thier large breed healthy dogs out after dinner until they left for work the next morning. Some rides would be as many as 10-15 chases in sequence, which is motivating in a certain fear for your life way to a young teenager on a 10 speed.
After some discussion, my Dad and I concluded to take the battle to the dog instead of being the victim. We have wheels and brakes, they don't.
1. Dog barks coming out from driveway. Backtrace their trajectory for a head on collision. Dog runs away yelping.
2. Dog comes in from behind, typically silent. More of a concern since they don't give away the stealth as quick. Slow enough for the dog to come close, then either bunny hop sideways to whack it with the back wheel(admittedly not as effective when touring) or come to as sharp of an all stop as you can, driving the dog into the back wheel. Same effect as hitting it with the bike. Most commonly used move with most success in my experience.
3. Repellant. Get a set of super bright LED headlights that can strobe, mount them to the back on a switch with 45 deg separation from the rear. Full flashing strobe has a remarkable effect at throwing off their concentration, often resulting in inability to walk or run. If red-lensed it works for a tail light too, but for a strictly dog repellant I would keep them white. Rather entertaining to see in action and the best part is no-contact.
Main thing with these methods is they are not considered to be 'illegal' or 'assaulting' on the dog, which can breed major problems with police if self defense was unproven.