I have been riding bicycles through areas fiercely defended by dogs since I was a young lad. I have been chased by some of the most ferocious critters you could imagine. I have been bitten a couple of times, never badly enough to require a bandage. I respect them, but I am not afraid of them. My biggest fear is not getting bitten, but having the dumb animal stop in front of me and running into it.
Most dogs will stop pursuing me if I simply tell them "NO", just as their owner would or as I would my own dogs. Some are a little more persistent but will slow down or stop when I raise my hand in the air while commanding them to "stop" and "get back in your yard". If they continue and get close to me, a spray from a water bottle will turn most dogs around.
In the rare worst case where the dog is hell bent on attacking, I will stop my bike and put it between the dog and me. This happened a few times when I was a child, before I learned how to command dogs with my voice. It has happened no more than a couple of times as an adult.
The old adage is true. Dogs can sense fear. If you are not in charge of the dog, it will be in charge of you.
One thing I always remember when riding in a group. I don't have to be faster than the dog. I just need to be faster than one of the people I'm riding with.