The question is, does it go back to Am after this B7, or on to an E7?
Usually, it would.
What you have is a "cycle of fourths" progression (all-too-often called a "circle of fifths" progression) in A Dorian.
The D7 occurs naturally in A Dorian. It is a Dominant 7 STRUCTURE chord, but not a Dominant FUNCTION chord.
And that's the important distinction: not all Dominant 7 STRUCTURE chords have Dominant FUNCTION.
The F#dim (which would be m7b5 or half-diminished 7 in the key) is also often a Dominant Function chord a lot of times - if this were the key of G, both D7 and F#dim(%7) would both be Dominant FUNCTION chords.
However, since this is assumed to be centered in Am - it makes it A Dorian (that's a common Santana vamp BTW, such as Evil Ways and Oye Coma Va, which are both Gm7 - C7 and Am7 - D7 respectively, making them both im7 - IV7 in their key - a Dorian i-IV vamp).
If you do include an E7 to take you back around to Am, the E7 is the chord with actual Dominant FUNCTION (and it's a Dominant 7 structure) where the D7 and F#dim are simply other 7th chords in the key.
The B7 would be acting as the V7 of the V7 chord (E7) in the key of A (because in A Dorian, the B chord would be a m7 chord).
If you look at the numbers, they're all 4 steps apart:
i - IV - VII - III - vi - ii - V (the last assumed since it's not there).
You can actually extend the "Dominant 7th structure and function" of the next chord throughout this cycle, so it would go:
Am (A7) - D7 - G7 - C7 - F#7 - B7 - E7 - Am
There's a weird (but necessary) jump from C to F# which is functionally incorrect (C7 should resolve to F as V7 of that key) but since it's Dorian-based, one might want to keep the F# - so it's still a 4th movement and the jump is acceptable, just not functional like all the others are.
Each 7th chord - G7 is V7 of C, F#7 is the V7 of B, etc. - each 7th chord is the V7 of the next chord in line, and when it gets there, that chord becomes the V7 of the next chord.
So you can "stay in the key":
Am - Dm - G - C - F - Bo - E7 ("I Will Survive" is like this)
or "stay in a mode":
Am - D7 - G - C - F#dim - Bm - E7 (similar to yours) in Dorian.
or use the secondary dominants at any place along the line in either.