The first thing to remember about dogs is that you need to keep control of your bike. IME more cyclists cause their own crashes when confronted by dogs, than dogs cause direct injury to cyclists.
I've seen people crash while trying to spray dogs with Halt, ot trying to swing a pump at them, or take a foot off the pedals and kick at them, and so on. So rule number one is keep control of your bike.
My most effective way of dealing with dogs these days is to authoritatively shout Go Home! and most do. If I can outrun them I do that, and most break off the chase at the property line.
Ultimately if you can't get them to break off the chase, and you can't outrun them, the best thing to do is dismount an keep your bike between you and the dog. One dog can't get around a bike you use as a shield, and after a minute or two will get bored and go home.
BTW- I was bitten once in my almost 50 years riding. A small poodle sitting quietly next to his master, all innocence, timed it out and latched onto my ankle as I rode by.
__________________
FB
Chain-L site
An ounce of diagnosis is worth a pound of cure.
Just because I'm tired of arguing, doesn't mean you're right.
“One accurate measurement is worth a thousand expert opinions” - Adm Grace Murray Hopper - USN
WARNING, I'm from New York. Thin skinned people should maintain safe distance.