Yes, you should always wash your hands after petting a dog, especially if the dog is not yours. Dog saliva can contain many bacteria, so cleaning your hands thoroughly after coming into contact with it is essential.