Punishment does not have to come as physical harm. You do not have to beat your dog or starve him. Just like dealing with some naughty kids, there are smart ways to educate them to behave. In my opinion, you can teach your dog a lesson by taking away his favorite toys, or skip a special treat or two. There is no real harm done in such case.
Of course we'd like to avoid any kind of punishment unless it is absolutely necessary. You just can't ignore it when for example your dog repeatedly bit your guests, or if your cat continuously to pee in your bed. Something has to be done to teach them not to do certain things. It is up to you to come up with a non-violent way to solve the problem peacefully. If you ignore the bad behavior instead, in my opinion it is not good for anyone including the dog himself. For the greater good, some form of harmless punishment is needed. Be creative.