The "simple past" is used to describe repetitive actions and habitual situations in the past. Some grammarians suggest using the simple past in questions for reasons of euphony.
Did you have a dog [when you lived at home]?
"Used to"" works like any other regular verb. When it is used negatively or in a question with the auxiliary verb "did", the "d" is dropped from "used" .
• I used to have a dog. (Affirmative)
• I didn't use to have a dog. (Negative)
• Did you use to have a dog?
It is hard to hear the difference when speaking.