Professionally trained attack dogs, patrol dogs, and guard dogs can see right through a person's disguise. A burglar can try to charm a guard dog with an amazing show of confidence and fearlessness, but he will be in for a big surprise. No matter how well he acts the part, he will never win over a well-trained dog.
Household dogs, however, are not always trained the same way, and will use only instinct to decide if he's going to stop you where you are, or allow you to pass through. The dog will be able to sense whether or not you're legitimate, if given the time to study you. So, if you are visiting a friend's house, delivering a package, reading a meter, or doing anything that is truly legitimate, give him the time he needs to let you through. Allowing the dog to get to know you is the secret to passage.
If an owner tells you the dog isn't going to bite you, don't be so quick to believe it. Many owners ignore their dog's warning, realizing their mistake only after it's too late. The owner might tell their dog has never bitten anyone, but even if this is the case, give him the time to get to know you.
The dog doesn't know you're an invited guest, but sees you as an intruder in his home, on his territory. Let him see for himself that your intentions are good. Introduce yourself to him. Meet him on his level. Talk to him, and allow him the time to use his scent discrimination.
It is important for kind people to be cautious when approaching an injured, lost, homeless, or starving dog. While your intentions are good, the dog doesn't always understand what is happening. He may have been hit by a car, and he has no idea why, but only knows he is hurt. He feels pain and fear, and his only defense might be his bite.
To let the dog know there is nothing to be afraid of, speak softly and gently to him as you slowly secure his mouth shut so he cannot hurt you. To immobilize the dog's mouth, you can use a piece of rope, a rag, a belt, or anything you can tie gently and securely so that you can safely move him to a safe place to administer necessary treatment.
If the dog is injured, the last thing on his mind is making a new friend. Don't take this personally. He is feeling vulnerable, and his main concern is to survive and protect himself against anyone who might hurt him. Even you, as he might not yet be clear on your intentions.