I certainly agree that you should never strike a dog, cause them pain or harm them in any way in an ill-conceived attempt to discipline them.
That said, despite how human-like dogs sometimes seem, they descended from wolves, Canis lupus, and are actually classified as a wolf sub-species, Canis lupus familiaris. The reason that I mention this is because it helps to understand how dogs think and how that thinking differs from our own.
Wolf packs are organized into highly structured hierarchies, where each wolf knows its place within the pack. To a dog, the family that it belongs to (whether humans, other dogs or a combination) is its pack, and it will try to find its place. Each dog's personality is different, but it's entirely natural for a dog to challenge authority as part of how it determines its place in the pack.
It's very important not to let any challenge by the dog succeed. A dog will interpret successful challenges as an increase in its pack status. The interesting thing is that a dog will feel just fine at any rung on the pack ladder as long as there is no ambiguity associated with its position there. Ambiguity in the pack hierarchy causes anxiety in dogs, and this can lead them to challenge authority in an effort to firm up the pecking order.
I was once in an obedience class with a 4-month-old pup. An older lady was also in the class with a bishon frise. It soon became very clear that this poor lady held no sway over her dog at all. The dog would routinely ignore everything she said, and those things usually consisted of asking and pleading with the dog to obey, which it never did.
After about an hour of this, the professional dog trainer who was running the class, asked the lady if it was alright if he showed her what should be done. He took the leash, and began trying to work with the dog. The dog, of course, assumed it was in charge and disobeyed him.
The trainer immediately dropped to his knees, grabbed the dog, flipped it over on its back, bared his teeth, put his face about three inches from the dog's face and, in no uncertain terms, held it there for about 30 seconds while he yelled at it in a low, very firm voice. The dog resisted for awhile, then pee started dribbling out onto the floor.
As soon as the trainer saw this display of submission, he immediately let loose of the dog and, like magic, the dog lost most of its previous attitude and began obeying the trainer. When the dog obeyed, he lavished it with enormous praise, but when it disobeyed, he immediately responded by reminding the dog that he was dominant. I doubt that the older lady ever managed to establish dominance over her dog, but it was a good education to the rest of the class in dog-think.
It's extremely important to always be good to your dog, be friends with it and love it. It's equally important that this occur within a framework that the dog understands and respects. You absolutely don't want ambiguity over who is alpha. If the dog understand that its role is further down the hierarchal ladder, it will usually be just fine with that role — as long as it feels secure, needed and appreciated in its place in the pack hierarchy.
Every dog needs to learn that good things immediately happen when it obeys alpha and that immediate and unhappy things happen when it disobeys. As for pups, they're just learning this stuff, and they're still exploring their way through it all. That being the case, you need to make special allowances for pup (child) behavior, but it's important that you always win each and every disagreement that you have with your pup.
If there's any question over whether or not you'll win, don't fight the fight — you can't afford to lose. For example, if you're teaching your dog to come. Never, ever let it not come when you call it. When it comes on its own, praise it effusively, but if it doesn't come, you absolutely must immediately track it down and bring it back. The dog must understand in no uncertain terms, that one way or another, when you call, it WILL find itself coming back and that good things will happen when it comes back on its own.
Like I said, ambiguity in the hierarchy will make an anxious dog, and that ambiguity will invite challenges to your authority. The dog will be happy as long as it's knows its place in the pack hierarchy is secure, important and appreciated by you, the alpha. And just to be clear, never hit your dog — you don't want a fearful dog. Instead, you want a dog that loves and respects you as the leader. And it has every right to expect that you will love and respect it as the follower.