While most of us like to believe that dogs are harmless, lovable pets, the reality is that dogs can actually end up being quite dangerous. Coming across a dog that is either hurt or scared may indeed result in a dog bite. Dog bites can be very traumatic, so avoiding them is a good idea. Fortunately, dogs tend to give off very specific warning signs if they are about to attack. According to Petful, if a dog looks tense with its lips tightly together, tail tucked, and its ears pressed against its head, the dog is likely afraid and may very well bite.
Another sign that a dog may be looking to bite is if it has its ears upright, lips tightly together, is standing tensely, and has a raised tail. This is often a sign of a dog attempting to intimidate you. It is possible that the dog sees you as a threat to its territory and is looking to protect its grounds. Particularly if you are out in rural areas, it is not uncommon for dogs to be patrolling their territory. You are more likely to come across feral dogs out in rural areas as well.
Generally speaking, the best advice is to leave unknown dogs alone unless their owners are specifically encouraging you to make contact with the dog. The majority of dogs that people own are well-socialized, but not all of them are. It is also possible that the dog is up a breed that is simply more aggressive than others. Overall, if you notice that a dog is looking very tense, that is generally a bad sign.