I believe that the Megadungeon is not actually a classic D&D thing. I think the dungeons under Castle Greyhawk might have been a case, but despite people being really curious about it, it was never released. The later module titled Castle Greyhawk was a very different thing.
I seem to remember people talking about how megadungeons only became popular at the very start of the oldschool revival, and even then only for a short while.
But you could indeed take a Moldvay dungeon and just make it a lot bigger. I used a 36 room dungeon as an example because it felt like a good size for "one adventure". Make it 360 rooms, and you'd have 120 monster groups in the dungeon. And players likely spending so much time in there that they might have another 120 random encounters on top of that.
One archetype of a megadungeon in fiction is the Conan story Red Nails. In that one, the underground city is almost completely empty and the heroes spend a good amount of time there before they even become aware that there are still people living in it.
A little snippet that occured to me and might be interesting to mention, even though it's obvious and banal in hindsight: When you use the wandering monster tables for different dungeon levels and adjust the size of monster groups bases on which level they are on,
dungeon levels don't have to be floor levels.
If you have a giant tower, you can have three floors that are level 1, three floors that are level 2, and so on. Similarly, the first floor of a dungeon doesn't have to be a level 1 dungon. You can have a dungeon with four floors that are level 4, 5, 6, and 7.
Sorting the sizes of monster groups by dungeon level is a convenient way to make the players aware that they are moving into a new area with a different degree of danger. This allows them to calibrate the difficulty of their adventure, by chosing to descend a level where rewards a bigger when things are getting boring where they currently are, or to go back to somewhere less dangerous if they feel the current risk is too high. But those gateways between dungeon levels don't have to be stairs. A method that I think is very useful is to have some kind of notable doorway that stands out from the environment to highlight its significance, and to give each dungeon level a different look. Like in Super Metroid, the gold standard for dungeon exploration.

You can have the ruined cellars be dungeon level 1, the caves dungeon level 2, and the ancient crypt dungeon level 3.