Hard to say. I'm usually confident in being able to see the dogs intent just from growing up with dogs but you never know. The chance of getting hit by a car is 10x more likely than running into a pack of feral dogs or even a lone dog willing to chase you down and bite. If you feel threatened that the dog might actually be charging to attack, stop and scream yell growl back. That's enough form most dogs.
I worry more about people on bike trails walking dogs without leashes or with 30 foot cables and almost hitting them in some of the windy treed areas.
That said I've had two experiences. One, I nearly ran over a small dog not on a leash at which time I screamed so loud at the dog owner I think they peed their pants - it's their fault not the dog. The second time a med size dog tried to bit my leg after following for a few yards at which time I promty jumped off the bike and broke the dogs leg with a heavy kick with a hard shoe. Happened recently and I have no remorse. Dog limped off and the owner, who I think was the owner, back at a distant house didn't have much to say.
Dog bites me and it's getting beat - period. Trying to pet strange dogs and getting bit is totally different, but if a dog stalks, chases, or comes up to me - different story. I love dogs, but there is no excuse for raising attack dogs, and or beating you're pets into being aggressive a-holes. Those dogs and dog owners have it coming if they are not acting like they are holding a weapon and keeping it secured at all times.