Again, why does it recognize Dm-G as dorian and not melodic minor? Or does it? Things that cross my mind:
1. in these chords we don't hear melodic minor's characteristic M7, so perhaps we default to the mode whose characteristic intervals we have heard.
2. the chords themselves still leave entirely ambiguous the exact mode, and other parts, e.g. the melody supply the distinguishing info. It seems counterintuitive that i-IV would be typically dorian though if it doesn't establish dorian by itself. i9-IV would though...
3. the brain expects to hear the diatonic sequence of intervals regardless of which of its notes you start from, so dorian is a default where there is ambiguity. This could be physiological relating to how our brains receive the series of 4th/5ths that comprise the diatonic scale, the overtone series, and sequence of frequency ratios between intervals, but I'm out of my depth on that. And/or...
4. We're just trained by convention to hear i-IV as typically dorian. But does my 2.5 year old daughter who's never heard Santana have this training somehow?
5. Hearing i-IV repeatedly in a vamp, without IV ever going to bVII tells us we're not in the world of functional harmony. Melodic minor's typical context is within functional harmony. Between these two things we're likely to feel we're in dorian. But given that in functional harmony resolution to tonic is often delayed for some time, why is i-IV played a few times sufficient to establish dorian? Maybe it isn't?
If that's the case then I suppose it's 2-4 above or some combo.