1. When you want to pet a dog, avoid going too fast. Do not make a sudden move, especially if it is a strange dog. You can even try and squat close to the dog to invite it over.
2. If you and the dog are able to come closer, first try to stroke it around its ears. This is to check if the dog would not be aggressive towards you in the long run.
3. After this, you can try and move your fist close to the dog's nose for it to sniff it. This will help the dog to trust you more. The dog can even go ahead to lick your fist; do not be afraid; it is just a way to shows their affections. But mind you, do not unfold your palm while holding your fist. Else, the dog would see it as a threat.
4. If, at this stage, the dog still plays along with you, then you can go ahead and play with other parts of its body.
5. Notice if the dog likes your moves, but if not, kindly withdraw.