Thinking of it as D dorian with a passing chord is a perfectly good approach, but theres actually some cool jazz theory going on too. ignore this if its overwhelming - jamming and listening are much more important :)
Major chords built on the flattened second of the scale can work a lot like a chord built on the 5th of the scale. (in this case, that D# Major could work like an A Major). Thats because of an idea from jazz harmony called a tritone substitution.
I can explain how it works if you like, but i wouldnt worry too much.
The interesting thing is that chords built on the 5th "push" towards the root, and make us want to hear the root chord (Dm) next. and because the D# is related to that 5th chord, it also pushes towards the root.
its a very common thing in lots of styles to put a chord built on the 2nd of the scale before a chord on the 5th of the scale. the 2 pushes towards the 5 just like how the 5 pushes towards the 1. this is called a 2-5-1 or ii-V-I. Sure enough, the chord before the D# is an Em, which is built on the 2nd of the scale.
We've all heard that 2-5-1 progression thousands of times before, knowingly or not. and thats why the progression sounds satisfying - we can hear where it's "supposed" to go next.
a cool quirk of this one is that the 2 and the 5 are both from D major - so its a major 2-5 into a minor 1. It's like the Dm and the F are in D minor and the Em and D# are in D major! But it works just fine, because those keys are closely related.
Welcome to music Stack Exchange btw :)