

If everyone’s on the same page and wanting to play out a story, seeing how your characters and world changes in response to things not playing out as expected is part of the fun. It should never truly derail unless someone is trying intentionally to, in which case you need to talk about it. Or you got complacent and dangled a campaign altering thing too close for them to resist…
Of course nothing should be inflexible, but I’m just saying there’s no reason for every campaign to be derailed completely. If your players are actively going against the scenario something’s gone wrong. And yeah, if you give them the opportunity to do something, be prepared for it to happen and roll with the consequences.
Unless you play low level John Does every time, characters should know stuff about the world they’ve lived in their whole lives. And if none of that ties into the scenario are you playing a campaign or in a sandbox?