First off, even in what you might call "harmonically traditional/harmonically unadventurous" music for want of a better term, in minor keys the 6th and the 7th are traditionally "up for grabs". That means that even if the harmony is not doing any "funny business" you might well still see both major and minor 6ths and 7ths.
Traditionally speaking, classical musicians think of 3 minor scales:
So, before getting on to Coltrane:
D0 E0 F0 G0 A0 B0 ^c0 d0 ^c0 B0 A0 G0 F0 E0 D0
And the melodic, ascending and descending.
D0 E0 F0 G0 A0 =B0 ^c0 d0 =c0 _B0 A0 G0 F0 E0 D0
The rationale for this traditionally is that the sharp 7 is added to allow you to make a proper
V chord, but that it results in a scale that is "ugly" for melodies, and so it needs to be "fixed". Generally, traditionally speaking, you won't see the sharp 6 as a harmonic note, just as a melodic passing note
I could give examples and stuff, but I'm sure there are plenty of better answers out there already for dealing with harmonic vs melodic vs natural minor. And you absolutely should look that up.
However, we are talking about jazz.
This real book cheat sheet is loosely based on Coltrane's recording of my favourite things
. And your basic observation of "aren't the first few bars implying one sort of tonality, but then the next few bars implying a different one?" has a simple response:
The genius of this arrangement is specifically in the fact that it takes a simple melody, and recontextualises it harmonically in a way that breathes new life into it. "My favourite things" is a sort of "pom piddle piddle pom" jaunty little tune that you might whistle while you cut your hedges. And Coltrane turns it into this meditative ethereal, soaring sound painting. And all without changing the melody at all.
Now, how does he do this? There's a lot of elements, but let's just look at the harmony (and only a little piece of it). I'm going to use a lot of subjective language, and bend some theory language to its breaking point here, but please, if any term I use isn't clear to you, please don't hesitate to ask me for clarification.
The implied "sound space" of the melody alone is a kind of a "traditional minor" song. However, the melody doesn't actually use the 6th until very late in the song, and so Coltrane uses it to his advantage. Think of it a bit like those videos where someone draws a cartoon of something, and then adds a few lines to turn it into something else (like the man with no arms turning into a dog): any space "left out" by the melody allows the arranger to fill in the gaps. And to mix visual metaphors, you can fill the white space with any colour you choose.
This melody, for the first few bars, only has 3 notes in it. 3! So the reharmonisation potential is enormous. Now, other notes come along later, so you don't want to back yourself into a corner which you can't get out of easily, but done judiciously it allows you to do some really interesting things with the music.
At the beginning of the piece, they set the scene with a "dorian vibe".
And then, with the same melody still playing, bringing in the Cmaj7 brings you to a new headspace and you hear the same melody again, but it somehow sounds different. The artfulness of this is that the piece starts by sounding like this open meandering free jazz thing, but then suddenly it's a julie andrews melody, but suddenly it sounds completely different. And then it changes again, and it's recontextualised again, and it's somehow still a Julie Andrews song but you're somewhere new.
Now nat6>b6 is quite a distinct sounding change, it has this sort of "inevitable" vibe to it. In fact it's so strong and pleasing that it's enough to build an entire song out of:: Portishead did it and it's great:
That entire song is basically Em Em/D Em/C# Em/C* And it sounds great.
OK, so that explains why the motion is pleasing, but what about Dorian in the first place. The chords establish this Dorian vibe, and it's a theme throughout the arrangement. So what are the main differences between "minor" (using "minor" in its strictest sense now, sometimes minor just means any scale with a flat 3) and "dorian"? 2 main things:
1) the 6th, obviously. Why is this significant? The flat 6th can be (of course everything depends on context), one of the "saddest" or "darkest" intervals. And and it's also used to build what can be some of the most mournful progressions. Em-Am is a very mournful progression, whereas Em-A is strident, triumphant sounding. Now often you don't want it to go that far, but you can disguise the natural 6 movement in more ambiguous chords (A9, A11, Em7) so that instead of sounding "triumphant" it sounds more "airy" and "open."
2) You may have noticed that, out of the 3 "traditional" minor scales with sharp and flat 6ths/ 7ths, the dorian isn't included. Why? Traditional tonal/diatonic harmony is all about strong chord movements and resolutions, and the dorian doesn't have many of these; there are a few, but not many. In a sense it really is one of the most "modal" modes. That may seem like a tautology but let me elucidate: Dorian's strength isn't the harmonic movements (changes between different, stable chords) it provides, although it has a couple of interesting ones. It's main strength is that you can treat it as more of a sort of "tonal palette"; none of the notes really clash with each other, so you can just paint these spacey, ambiguous, extended progressions without much functional movement, and instead of living in a world of cadences and resolutions, you can just bathe in sound, and explore the colour or different chord qualities and voicings in a non-linear way.
*OK it's in E flat, but I transposed it for the sake of illustration.
The fact that this is done with "my favourite things" is part of the aesthetic, the juxtaposition of a plain old melody against this soundscape and the way they dance around each other is part of the appeal.
Later on in the song they switch it up again, to a major key centre: the melody doesn't include the minor third so it's possible to play it over a major chord, and this is when it gets really interesting in my book
tl;dr the chords at various points in this song switch around from different implied modes and keys in order to keep creating new contexts for the same melody. It's not just dorian: later on it switches to major too