I mean, you clearly get this, but the problem with these questions is there are NEVER quick answers.
That’s also what’s awesome about music - there are almost infinite ways you can approach even simple chord progressions.
Something like this, I’d almost always suggest by looking for a single scale that you can play across everything, and if your overall tonality is clear that you’re resolving to that A minor, then A Dorian is probably your best, most complete answer.
But, it’s hardly the only one - two other off the cuff ideas that could be fun:
- You could look at it as two tonalities, not one, and play A minor for Am-G, and then E minor for Em-D, and try to emphasize the way the F in Am and the F# in Em shift - for bonus points maybe make that a G7
- You could throw scales out the window and play arpeggios exclusively for each chord, which would have the added bonus of helping you really focus on chord tone resolutions. If you wanted to get fancy you could start adding in passing tones - say, walk down from the Am to the G with an A-Ab-G line and play the G as you resolve to the new chord, or from the 5th of the Am to the 5th of the G, E-Eb-D.
- as others have pointed out, Am Pentatonic doesn’t have the 6th degree, which would be the major 3rd of D, so you can gloss over that pitch by playing pure pentatonic or blues runs. You could also play a pentatonic but add in the M6 when playing over the D to highlight that color a little
I’ve never liked describing theory as “rules,” because the only real “rule” in music is if it sounds good, it IS good What you have, though, is more of a “toolkit,” and a whole bunch of concepts that can help you understand why things sound good.