The "rule" is basic English grammar: "hear" is present tense, and "heard" is past tense or past participle tense. When we use a word like "did," we use the present form of the next verb, because "did" is already telling us it happened in the past. This applies to all verbs... there is nothing special about "hear/heard."