In order to pet a dog, you must first obtain a dog. You can do this either by adopting one from an animal shelter, hanging out on nature trails and wait for one to walk by, or you can find someone you know that has one of these animals.
To pet a dog you must first allow him or her to smell your hand with their nose (located on the end of the long part of their face). Once the dog approves of the scent of your hand, you must gently place your palm across the dog's head, right between it's ears. You then run your palm (facing down) along the dog's fur. Pet down to about it's neck, then lift your hand and return your hand back to the place you originally started petting.
Once the dog is bored of your light petting, you might want to try gently scratching the dog's ears, right where the ear joins it's head. If done right, the dog will look up at you and smile in approval. If a dog cares enough to roll on it's side and gaze longingly into your eyes, this means that it would really like it if you placed your palm on its stomach and give it a rub-a-dub. Dog likes it's tummy rubbed because it feels good man.