Dogs are better than people. I never had any real problem even with the most vile dog that i have encountered. It just barked at me and i slowly passed it by walking. They are just protecting their territory. If a dog is not crazy or not "raised" crazy, it will never try to bite you unless you threaten it or try to "run away" from it. Running from a dog triggers its hunter instict. You should stand your ground and move slowly. Do not turn your back on a dog. It will leave you alone once you are out of its territory.
PS: I have survived encounters with more than 10 dogs attacking me in rural areas. I know what i am talking about. More dogs, less men. That is my motto.