There is only ever one tensed verb in a verb phrase (ignoring coordinations like "goes and eats"). If there is no auxiliary, then the main verb of the sentence is tensed. If there is an auxiliary, then the main verb takes a non-finite form: the past participle with have (for a perfect tense), the present or past participle with be (for a continuous or passive form respectively) and the base form (or 'infinitive') for all other auxiliaries.
So if there is a do (does, did and their negatives) introducing a main verb, the main verb is always in the base form, even if the main verb is a special one like have to.
Edit: so "does it have to" is grammatical, "does it has to" is not. (Thanks to Hellion for pointing out that I didn't actually say this in my answer).