I don't let dogs get close to my bike.
I had an ankle nipper chase me a few years ago, and was more worried that the dog would do something unsafe than have it bite me. It did eventually break off the chase, maybe a block from its home. I hope it made it back.
I will yell whenever I see a dog on the road. I have an up and back ride I do from time to time. On the way headed out, about 3 dogs chased me one day. My yell can probably be heard for a mile. I was cautious on the way back, but no dogs then, or ever again.
There was one dog that barked at me at the turnaround once. After I yelled "GO HOME", it simply went back and sat at the corner of its yard. That was its safe place, and it could stay there. I've seen it out a few times, but never any problem.
The closest call was when I passed a dog owner who said "It's a sweet dog" right before it nipped my handlebars. I should have reacted quicker, but ultimately no harm.
And, just one dog that I wish I had mace. Chased me about 1/4 mile along a moderately busy road. Fortunately just past a gentle crown in the hill. It never broke off the chase. I've been back past there a few times, and no dog.