The hostile creature’s movement doesn't provoke an opportunity attack from you, so your War Caster feat isn't triggered.
The War Caster feat (PHB 170) says:
When a hostile creature’s movement provokes an opportunity attack from
you, you can use your reaction to cast a spell at the creature, rather
than making an opportunity attack. The spell must have a casting time
of 1 action and must target only that creature.
The hostile creature’s movement doesn't provoke an opportunity attack from you, so your War Caster feat isn't triggered.
The Dimension Door spell description (PHB 233) says:
You teleport yourself from your current location to any other spot
within range. You arrive at exactly the spot desired. It can be a
place you can see, one you can visualize, or one you can describe by
stating distance and direction, such as "200 feet straight downward"
or "upward to the northwest at a 45- degree angle, 300 feet."
Dimension Door is a teleportation spell, and teleportation doesn't trigger opportunity attacks.
The rules on opportunity attacks (PHB 195) state:
You also don't provoke an opportunity attack when you teleport or when
someone or something moves you without using your movement, action, or
reaction.
Additionally, spells do what they say they do, and the spell description of Dimension Door does not say it creates a door that you need to pass through; it merely teleports you to the spot within range, so the proposed mechanism to prevent the teleportation from occurring wouldn't work, either.
Thank you to nick012000 for contributing the additional note.
It's definitely against the rules, but not unreasonable
The scenario as presented is fairly reasonable, but the ruling isn't RAW, and if this irritated you it's completely justified.
Plainly put, forced movement breaks grapples, and it doesn't care which creature is moved.
PHB pg. 290 under conditions, Grappled:
The condition also ends if an effect removes the
grappled creature from the reach of the grappler or
grappling effect, such as when a creature is hurled
away by the Thunderwave spell.
On top of that, Water Whip is a Dexterity save, not a Strength save. It also doesn't have an escape DC, which is telling. Like Thunderwave or Thorn Whip, when something gets moved by it, the magic is what's doing the moving and the only way to avoid that is to pass your Dex save and dodge it, or to use magic to counter it.
So in this scenario, your Water Whip should have torn the restrained party member from the grasp of whatever was dragging him. It doesn't matter that he's grappling the target. If the DM didn't want the thing to let go, the DM should have had it get dragged along with the restrained character. As a DM myself, when I do play a character and I'm escorting something I've restrained, I make it a point to tie myself to the creature I've restrained specifically to prevent scenarios like this from ever happening. I also keep a tether on my weapon for the same reason.
As for this:
His logic was that you couldn't make a Water Whip to a creature restrained, and chained, to a wall and expect it to work.
This is actually bad logic. This is called a false equivocation fallacy, where the scenarios are not discussing the same thing. Walls and chains are unyielding, inanimate objects anchoring the target because they're fixed.
Best Answer
Yes, it is a choice. Or more specifically, you must pull the creature, but you can pull him 0 feet.
The spell does exactly what it says. Many spells and abilities give you the ability to choose, by including the appropriate wording. This one specifically allows you to choose the length you pull the creature (0-10 feet).