You love dogs, but don't be surprised if they don't love you back ... immediately. Like people, some dogs are more friendly than others, and new dogs in particular may take a while to be cordial. New dogs can be especially nervous or scared, so greeting them takes patience.
Give the dog plenty of space. Back off if he barks viciously or bares his teeth. Never maintain direct eye contact, which threatens the dog and may antagonize him to bite.
Ask the owner if the dog is friendly and likes people. If the owner says no, do not force interaction with the dog. However, if the dog is friendly, give him space and allow him to approach you first.
Turn your body sideways, extending the back of your hand out toward the dog with a piece of kibble or small dog treat in your closed hand. Both postures are non-threatening, subordinate gestures. Do not touch the dog. Wait for him to sniff or touch you first.
Offer the treat or drop it on the ground. Once the dog sees that you are non-threatening, try touching or petting him briefly under the chin or on the chest area, and then stop. If the dog seems friendly, continue to pet him gently, but only for a short period of time so as not to overexcite him.