There are two issues you will run into. First, you are likely to observe a sudden increase in the behavior, or what is know as an extinction burst. Think of it from the dog's perspective... this has worked in the past, so keep trying and it will eventually work again. We might expect this sudden increase in scratching for a while, and then the rate of scratching should gradually decrease until it is extinct.
We are especially likely to see an extinction burst if the behavior was previously reinforced on a variable schedule and if reinforcement is suddenly removed. In the dog's experience, sometimes it scratched for two seconds, sometimes ten, and sometimes for two minutes before the door opened. Since a variable schedule is unpredictable, the animal is already accustomed to persisting until the reward arrives. Therefore, it will take longer for the animal to learn that the reward is never coming and give up on the behavior as a way to get what it wants.
One important point to stress is that is we want an behavior to go away, we have to be very consistent about not reinforcing it. If we accidentally give in at times and allow the behavior to be reinforced, we end up introducing an even more variable schedule, which will make the behavior even more resistant to extinction.
The final issue you may run into is known as spontaneous recovery. A some point after a behavior has gone through extinction and stopped, it may suddenly reappear for a bit and then go away again. That unexpected (spontaneous) reoccurrence (recovery) of the behavior is perhaps best thought of as a mechanism by which intelligent animals test out the environment in case the problem was only temporary and things are back to the way they used to be. As long as you ignore it, a spontaneously recovered behavior should go extinct again in short time.
In cases like this, we can facilitate extinction if we replace the behavior with something else that we want the animal to do. So, for example, we might reinforce the dog for sitting calmly by the door, or for ringing a bell by the door with its nose. Thus, rather than scratching because the dog doesn't know what else to do, it will learn to abandon one behavior in favor of a more desirable one.