The shutting and opening door trick can be taught to all dog breeds. The only consideration maybe would be asking small size dogs to close large or heavy doors which are beyond their physical capabilities.
In teaching this trick select a door that swings easily on its hinges; drive a nail, or simply stick with double sided a makeshift hook on your door at such a distance above the floor that the dog can just reach it by standing on his hind legs with his forefeet resting against the door.
Open the door a few inches, place a small piece of treat on the hook and call your dog’s attention to it, saying “Shut the door.” In reaching for the treat the dog will place his forefeet on the door and this will close it. If preferable the treat can be balanced on the door handle, and shutting the door will jar it to the floor, when he should be allowed to eat it and be petted and praised.
After be has done this a few times you can advance him in his lessons by placing the treat in position while he is in another room, then call him in and say “Shut the door,” directing him toward it, and if he does not go, show him the treat and encourage him to get it. In time he will understand the order and will close any door that is shown to him.
Finally, teach him to close the door without having any reward in sight, but after he shuts it in response to your command reward him with a treat. In the first lessons you need not be particular about having the door closed tight, but in later stages, insist upon its being done before any reward is given.
Dogs can be taught easily to open swinging doors, but opening fastened doors is a much more difficult act, and is possible only with those that have the easiest and simplest latches.
To teach a dog to open a swinging door call his attention to it and push it open at the bottom. Do this a number of times every day for several days, then go through the door, closing it after you, and leave your dog on the other side; call him and he will soon learn to push the door open in order to reach you.
To teach a dog to open a latch, hold the dog up to it and push it back with his paw, and say “open door” to associate this trick with this command and continue to give him practice in this way until he will push it back without your assistance.