If the hair on the dog's back is standing up, the dog is telling you he is threatened or upset.
It is best not to rely on just one behavior too judge whether a dog is safe to approach.