It depends on how you are using the words. If you say, "He sold the books door to door" you mean he sold them ffrom door to door. He is then a door-to-door salesman. The hyphens are put in because...
Some suggestions for avoiding door to door salespeople are: not answering the door, not letting them come in, and being polite and holdin your ground. If those don't work, get a big dog.