If it's in combat, there's not much you can do beyond counterspell or hem them into a Silence spell. Dimension Door is intended to be the low level escape spell (often replaced by Teleport later), and so it's doing what its supposed to do.
Outside of combat, there are several ways to keep them under wraps. You can keep them unconscious by damaging them every half-hour, then using Wis/Medicine to stabilize them again. You can bind their hands, blindfold them, and gag them, preferably with someone standing guard in case they move, preventing them from casting (unless they have Silent Spell). To interrogate, you can remove the gag; they can Dimension Door away at great risk (not knowing what's in the direction they're teleporting to).