This question originally appeared on Quora, the best answer to any question. Ask a question, get a great answer. Learn from experts and access insider knowledge. You can follow Quora on Twitter, Facebook, and Google Plus.
Answer by John Buginas, SF/SPCA Academy for Dog Trainers, instructor, 2006-2009, CTC 2005:
All dogs are different. Like people, most dogs will "tell you" if they don't like what you are doing. They can't talk, so they will tell you by flinching or moving away, punching you with their noses, or growling. As with people, your relationship will go best if you respect their boundaries and respect their personal space. And, as with people, once a dog is familiar with you, the two of you will learn how you can interact and have fun together.
Take your cues from what dogs do when they meet and play. Try not to get caught up in speculation about dominance or pack leader or try to be the alpha dog. Keep your eyes and ears open and watch what the dog is doing. If the dog freezes, stops breathing, starts to move stiffly, stares at you with dilated pupils ("hard eye"), or the hair on their back stands up, slow down! Your attentions are not wanted. A happy dog will approach you, move fluidly, wiggle, and avoid direct eye contact.
If you watch dogs greet, they rarely approach face to face. They usually approach in an arc and allow each other to sniff the other's butt, then decide if they want to play. During the greeting, many dogs will go stiff, and their tails will wag stiffly, until they've made their introduction and finished sniffing each other. Initial greetings for dogs are tense until they figure out if they want to play, avoid each other, or fight. Dogs who violate the initial greeting ritual by approaching face to face; refusing the sniffing ritual; or starting to play, mouth, or jump up on another dog are acting rudely. A botched greeting can escalate into snaps and growls. Don't be that dog.
A wagging tail is not always an OK thing with a dog. If the dog is moving stiffly and the tail is held stiffly upright, this is a sign the dog is tense. If the tail is wagging in huge circles, like a helicopter in big, loose motions, and the entire back end of the dog is wiggling, the dog is likely relaxed.
It's best to crouch to get down to the dog's level (if that's easy for you), turned slightly to the side. Don't approach head-on; let the dog approach you. When you reach your hand out, do so slowly, palm up, from a low position. Don't move your hand high, in a big arc, or approach their head. Let the dog sniff you--it's part of the ritual. (You don't have to reciprocate). Most dogs don't like to have you pat the top of their heads or to have hands approach their heads from on high. Most will like to have hands placed on their sides or backs.
Pay attention to what the dog in front of you does. It doesn't matter what your last dog-friend let you do to it; it's the dog in front of you that matters. Every dog is different. Some have parts of their bodies that they don't want touched. Stop what you are doing if the dog stiffens or rapidly pokes you with its nose. A nose-poke is a warning and is the closest thing a dog can do to politely saying "NO!" Think of a nose-poke as saying, Hey, stop that. Look, I can reach your hand with my mouth full of teeth. I'm giving you a warning.
Many dogs will maneuver themselves to a position so your hand is where they want to be petted. Listen.