But my point is this: could megadungeons be made into viable environments for the current more character-focused playerbase, is it possible to synergise the two gameplay styles when the map only expands down instead of out and caverns and corridors are 90% of what you see instead of the horizons of forests, mountains, giant cities and frozen tundras? A game where you know you’re going to be coming back through these places over and over so instead of just casting flight on the party to cross that ravine you hire carpenters to build a sturdy retractable bridge, set up a protected outpost as a safe retreat in the monster infested halls and build a rapport with the inhabitants of the dungeon town every time you pass by? Do you mug that wandering salesman for all they’ve got or point them towards the corpses of your latest encounter saying they’re free to salvage anything of interest to them?
So getting back to OP's original question: this is a question I've thought quite a bit about because my current campaign is a homebrewed megadungeon using 5e, and all of my players are very much of the more modern character-focused mindset. When I decided I wanted to build a megadungeon, I scoured through the forums here for every single thread on the topic, and I find it fascinating how diverse megadungeons can actually be, depending on what philosophy you approach them with.
Does my megadungeon recognizably have the same goals as the original, traditional megadungeons did? Not really. I think resource management is a completely valid source of tension in a game, but it doesn't interest me as a DM (at least right now). Nor am I interested in "kitchen sink" style dungeons, where any and every possible monster can show up. I see the value in these for more casual "drop in" play, but for a game where I intend to play with the same small group of players, ideally each with the same character, for a full campaign? Everything should have narrative purpose, including the monster types available to me.
I still adhere to the idea of partially building the campaign around the characters themselves and their backstories, except now both I and the players are keenly aware that maybe they aren't going to be able to simply stumble across the NPC who murdered their parents, so perhaps they need some backstory and character motivation that will better suit the restrictions of the setting they'll be playing in.
My players can't decide to run off to the tundra or an exotic city at the drop of a hat the way that an open sandbox game may allow, so it's my job to make the dungeon itself as vivid and diverse as if they got to explore an entire continent. A few sessions of walking around in damp, dark caves is spooky and fun. Ten sessions of that sounds profoundly boring. The dungeon should be consistent, but also it should change as they move deeper, feature different zones that offer a different feel, and it should also change over time. There should be lots of branching options so that they don't feel like they're walking down an endless corridor of DM railroading. They should have multiple overlapping goals as both individuals and as a party so they can have many small victories along the way and feel the sense of progression that would normally come from clearing a small dungeon and then leaving.
Also, time is real and continues to move forward, both inside the dungeon and outside it. Every time they back out of the dungeon to take a break at camp, they will find things have changed. Every time they re-enter the dungeon, they will find things have changed. They will realize that there might be consequences for spending too much time without exploring, and the time wasted backtracking (especially as they delve deeper and walking in and out becomes a multi-day affair) might not be worth it.