If you have feral dogs in your area, call animal care & control. It's dangerous having them roam as they can pick up and pass on rabies, create a hazard for cars, and are a possible danger to children. I am a dog lover and it really makes me angry to see people get dogs and this is how they end up. The dogs always suffer.
I have found that when riding a bike, if you stop and get off, the dog stops chasing and usually won't bother you. After all the fun is over. If the dog still seems aggressive, I try to keep my bike between me and the dog and slowly walk away. Sometimes I carry dog cookies when I run or ride just in case. If you throw them a couple of cookies far apart from each other it will give you some time to walk your bike far enough away to get back on and ride away.
Stay safe and I agree that the drivers in the cars are probably more dangerous than the dogs!
"God gave you your body as a gift, so you should take care of it." - My Mom