Grammatically speaking what is "the door" in the following sentence?
To answer the door, she pulled it open.
Is it a modifier?
The door is the object of the verb answer. The phrase to answer the door is an adverbial phrase of purpose modifying the main verb or the praedicate.
"To answer the door" is an infinitive phrase that is functioning as a single part of speech, an adverb modifying the main verb in the sentence "pulled". That is why Cerberus correctly calls it an adverbial phrase. That should take precedence over the idea that "the door" is a direct object of "to answer." The reason being is that "to answer" is a verbal, and does not function as a verb in this sentence or any other; it is a "former" verb doing a different job, in this case, the job of an adverb. There is enough "verbiness" left for it to still take "door" as an object, but the whole phrase is functioning as an adverb. I've seen sentence analysis (in print...check out Michael Clay Thompson's work) that wouldn't label "to answer" as a verb and would skip labelling "the door" as a D.O. for the reason given.