You cannot teach a dog a behavior without taking into consideration the emotion the dog is feeling at the time it gives you the behavior. If you teach your dog with positive emotional response to behaviors you want, your dog will be excited about giving you those behaviors. If you teach your dog with a pain response for every unacceptable behavior, you teach your dog a negative emotional response and can create aggression.
Say, for example, you pinch your dog or swat your dog in the same spot every time it gives you an unacceptable behavior. What you can create is a negative emotional response to the dog being touched in that spot. For this example, we will use the underside of the belly.
Then, along comes a child or a friend or a neighbor who touches that dog on that spot while petting him. The very real possibility is that the dog reacts with a bite for being touched in that spot because of the negative emotion you have created that relates directly to being touched there.