I looked up the chord progressions for all major and minor scale keys, but this combination doesn't match any of them.
Why does it work well?
Music: Practice & Theory Stack Exchange is a question and answer site for musicians, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
I would actually consider this to be ♭III - IV - I in B major, with the ♭III borrowed from the parallel minor key. In fact, with the ♭III chord, it's somewhat similar in character to one of the "Fellowship of the Ring" themes: I - ♭III - I (in your key, that would be Bmaj - Dmaj - Bmaj). It's the first three chords here.
Soundtracks aside, this type of chord progression is often used in modal blues pieces, or modal rock that is inspired by blues. The general idea is to reduce the dependency on dominant/tonic relationships (which is often replaced by subdominant relations, such as IV-I). The problem comes when you hit a minor chord that you want to change into a major chord. In more classical styles, this is done simply by raising the third, but this creates a secondary dominant that needs to resolve. In modern modal styles, a major chord is instead created by lowering the root and fifth of the chord a half-step (and leaving the third in place). This gives roughly the same result as if one played major chords whose roots were in the minor scale. The resulting chords sequence looks something like this:
I - ♭II - ♭III - IV - V - ♭VI - ♭VII
Notice how all the chords are now major, and there are no secondary dominants.
Not all the chords in a chord progression need to be strictly in the key. The best way to look at this chord progression is a ♭VII - I - V in the key of E major. The D major chord is a chord that exists in E mixolydian (on of the other modes of E) and it is very common for someone playing in the key of E major to borrow it. The E major and B major are just standard chords from the key of E major.
It is used a lot today without people realizing where it comes from. It generally tends to give the progression a slightly darker and if this is a looped progression would make it sound a little more dark because the when going from B major to D major, the major 3rd of the B majro chord (D♯) descends. You are most likely accustom to hearing similar types of progressions and that is why you like the sound of it.
While music can be very formula driven similar to mathematics the real stuff happens when you go away from the formulas or go put of the box. Flat 7 and Flat 3 notes & chords are very common particularly in blues and jazz. These variations from the norm are what can provide color and character to music.
When in doubt go with the words of the great Duke Ellington - "If it sounds good, it is good"