This is the best way I have learned how to approach a shy or nervous dog.
Do not face directly towards the dog and avoid eye contact! Crouch down so you don't seem so tall, and speak in soft assuring tones. Keep your palms up at first and your movements slow and steady. Practice patience. Do not expect or try to touch the dog for the first few interactions. The ultimate goal is for them to view you as an alpha protector and provider of resources.
You have to earn trust before you can establish a relationship like that. You earn trust in many ways, many of which you may not even realize you are doing.
maybe try to seize the exact moment a dog feels threatened or annoyed by some outside force, and remove the problem swiftly and easily. The dog may just catch on to the fact that you are here to help them.
This takes a good bit of foresight and perhaps a little planning.