I never found it helpful to think in terms of intervals from the desired chord; rather, the function of the chords involved helped this makes sense to me.
What Secondary Dominants Do
When a composer wants to make a "resting place" in a passage, a good way to do it is to set it up with a chord that resolves to it more strongly than any of the chords in the key can. To do this, you borrow a chord from the key of the chord you wish to end on. The best chord to borrow is the dominant of the chord you're trying to set up; so such chords are often called secondary dominants, and the technique is sometimes called tonicisation.
Any chord can be chosen for tonicisation, but probably the most common chord is the dominant (V).
We're in the key of D minor. The V chord is A (usually major). To make a passage ending with that A chord feel more final, it can be set up using an E chord, which would be the dominant in the key of A major. In the key of D minor, the E chord ought to be diminished (e-g-bb), but we instead use the chord borrowed from A major, which is e-g#-b. You'll notice two accidentals in the chord, which is a hint you're looking at a borrowed chord, and it resolves to the A major chord, lending it a stronger resolution than any progression solely within the key of d minor. To make it even stronger, use a E7 chord of e-g#-b-d, which will provide an even stronger resolution to A major.
Another common choice would be to use the vii chord to set up the A major chord. These are often still considered under the umbrella of secondary dominants, even though it is technically a secondary leading tone chord. In this case, the vii in the key of A major is g#-b-d; again there will be two accidentals relative to D minor and the chord will resolve to A major very strongly.
The V/V/V or Tertiary Dominants
To make it even stronger, a composer can borrow from the key of the secondary dominant to create a chain of very strongly resolving dominant chords. This is often done around modulations. So in the key of d, A major is the dominant chord. E major minor 7 (e-g#-b-d) is the secondary dominant. In the key of E, B major minor 7 (b-d#-f#-a) is the dominant. So in this case, we would use B7->E7->A. There are going to be a whole pile of accidentals going on, and a B Major chord can be almost impossible to explain in the key of d minor without a good understanding of how secondary and tertiary dominants function (a raised VI7 resolving to a II rather than a ii dim...huh?)
The V/III, or Using Secondary Dominants in Modulations
One more example, this time using the III chord, which is especially common in minor keys as a way of modulating to the parallel major.
In d minor, the III is F major. The dominant in the key of F is C major. So we set up with a c-e-g-bb resolving to f-a-c. While there are no accidentals in this case, the (major) VII is extremely rare, so it's a good hint there some sort of secondary dominant going on.
Some times you'll find secondary dominants or other borrowed chords that don't resolve to the chord they're borrowed from. These are "implication" chords, which imply their tonic without actually sounding it. Generally this technique is used to create a very weak progression, and is pretty much only found toward the end of the era of functional harmony.
Analysis Is Not Music
Ultimately, it's important to remember that most music is not written to be analyzed - it is usually written the way it sounds good and later analyzed to figure out why. Sometimes chords serve to tonicise other chords without being a secondary or even a borrowed chord, and sometimes a chord that could be a secondary dominant just doesn't function that way. But in common practice functional harmony, secondary dominants are pretty common.