This is of course a beneficial relationship for all concerned. You get what you want and the dog gets what he wants, making everyone more pleased. Some people say that the dog is actually happier because it craves rules and boundaries. Dogs will test you to see how far they can push you because they want you to define their limitations, to give them their place in the household. I am not sure how convincing I find this argument but it makes some sense, in the way it makes sense that children with rules and boundaries tend to be better adjusted as well.
For this reason among others dog training is an important part of any household that has a dog. I have seen the houses where the poor dog is locked outside all day and night with no affection and love because he is “out of control”. However in my experience this is normally because no one tried to control the dog and he was allowed to push his boundaries to the max until there ceased to be any. Dog training needs to be done, and to be done well in order for the dog to truly flourish.