If you have to, back away quickly.
Also, you probably can't outrun a dog.
@Lulz4l1f3 @Impious_Jade Also, don't stare into their eyes, but do not look completely away or turn your back. Canids, like other predators, prefer to attack things that aren't watching.
@Impious_Jade If a dog seems possibly unfriendly toward you, do not approach it straight on, kind of circle around. Approaching straight on appears as possible aggression. Also no shouting, etc.
A lot of dogs get shot by police around here because they get called, and the officer doesn't know how to deal with dogs.