I can't comprehend how the BBEG having a reinforced anti-teleport zone around his Fortress of Doom and Razorblades is somehow "unfair" if you want to use teleport to jump back to his throne room, beat him up, 'port out, rinse, repeat.
Because your limiting the Player's options.
You're limiti the players options to not let them build a nuclear warhead too1, or when you tell them that they should stop being Dockyard Mafia and go stop BBEG before he blows a continent off the planet2, or when the noble they beat up sends assassination squads after them3, or when they want to go wenching and you point-blank refuse4.
In fact, the DM really has two roles.
First, to structure the game world to provide something for the players to do
Second, to limit what the players can do in order to make the game more fun for the players.
1. False equivalence. D&D has clearly delineated rules for teleportation &c., and scry-and-fry is a classic tactic for half-decent wizards. That's nothing at all like the party in the fantasy adventure managing to assemble a functioning nuclear warhead with medieval or Renaissance-era tech. If the BBEG is a high-level spellcaster? Sure. But if it ain't, why the fuck does he have defenses appropriate for one other than "bluh blah I'm too lazy to deal with consequences of my own planning".
2. Not the same thing. That's you railroading the players into something they don't want to do rather than telling them flat-out that some of their skills are worthless because you said so.
3. That's a natural consequence of player actions. Likewise, not the same thing.
4. Also not at all the same thing. Unless it was genuine and non-creepy, but we all know how likely that is. Stopping magical-realm bullshit is well within any DM's reasonable purview.
The last bit I agree with. Except that you seem to be laboring under the misconception that what you/DM wants is what the players should want as well, and if they don't agree you should force them, even when there's no reason beyond "oh, that would make work for me because I planned out the entire adventure ahead of time without allowing for any deviation from the prescribed path through the narrative".
1. If the party is at a sufficient level for scry/die and group teleports to be standard things, whatever puppy-kicker they're up against has
no excuse not to have TAD. Even if they're not a spell aster, they can still have TAD of some form, either by just buying the casting off an extraplanar wizard, petitioning their God, building the Fortress of Doom and Upturned Thumbtacks on a natural site where raw mana interferes with teleport, or having the Legendary Macgyffin generate the TAD itself( Any artefact-maker worth their salt would want to protect the bearer from scry/die.
2. It would be railroading if you just refused to process the "shakedown level 1 dockworker" or "break into big Tony's warehouse" actions. It's not railroading to point out that this is a bad use of time if the BBEG they
know is trying to blow Gondowana off the mantle has already been established.
3.I don't see how the noble taking a reasonable action to get revenge on the band of muderhoboes is any different from the bad guy taking action to try and slow down the murderhoboes from murderhoboiing his evil ritual to open a rift to the Plane of Rusty Nails.
4. This was a pretty bad example, yeah.
What the DM want sand the players want should be reasonably aligned, actually. Otherwise either the DM or the players aren't going to enjoy themselves as much as they could. If either side thinks this is the case then they should meet up out of game, and talk about what the DM can do to fit the campaign towards the play style and goals of the players, and how the other players can work with the DM a little better.
For the second half of that statement you can fuck right off to hell and bounce in the beds, because equating "sometimes ye players must accept that there might be a counter to their plan" to "You're a terrible person who makes linear railway adventures and forces everyone to do what they want and only considers themselves" is Loud Whispers levels of wilful misunderstanding and flamebait.