I've learned that negative words like can't or don't are stressed in sentences. However, I've heard native speakers pronouncing phrases like I don't understand what's going on here, where don't is pronounced very fast and lightly, like a flap d. Is this so?
Yes, it happens. Auxiliaries, including "do", are function words, and so can be unstressed, and before an unstressed vowel, intervocalic [d] can be flapped. So after a vowel or diphthong, the [d] of "do[n't]" can be flapped.
In casual register under little-understood conditions, /n/ flaps as well as /t/ and /d/. In American English, this can lead to the impossibility of distinguishing "I can understand" and "I can't understand".