Aside from the fact is sounds good... Dm and G coexist in the key of C...
So we jump to a Dm there is kind of a jolt there an increase in tension... it's a key change... and we hang with it for a while... then we go to G, which is in C major along the the preceding Dm. So that transition is smooth. Now the next A is going to D. Which is a 5 going to a 1 chord.
When going to a 1 chord a 5 chord is often altered to a major chord. If you want to look at it like we started picking chords from the key of C (to grab the Dm and G) you could say we changed the Am to an A to make the resolution to the following D stronger returning us to the original major key.
Or you could look at it as we simply grabbed the Dm from the parallel minor... G sounds good because it is diatonically common to Dm (albeit in a different key, but they work together nonethess), and the song previously established the G to A harmony movement.
(You could look at what I call C major as D Dorian if you are ready to go there.)
Sounds good is good is easier...
Shadow