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...
A person selling from door to door is called: a. an outside salesperson b. a peddler c. a door-to-door salesman d. a solicitor (in America). A solicitor is an attorney in England.