I'm currently running a home built mega dungeon (that's the extra dimensional library of a Lich) in my main campaign and it's very viable.
For clarification the campaign is a 1 to 20th level one I wrote. The characters are currently 10th level and met when they were 2nd level (I ran an individual session 0 for each player as an individual adventure which explained why they were contacted to find the library). The first part of the campaign was the characters finding out about the library and traveling to it. They reached the entrance when they were 5th level and have been exploring the depths since.
When designing the actual library I made sure to design it where there are options for social interactions along with options to resupply, sell/buy magic, and downtime.
As an example I wrote in a small tribe of Azer that were once magically compelled to help the Lich, but at some point they were able to gain their freedom. The Azer have taken over a corner of the third level and are mining a small attached pocket of the elemental plane of earth (the Library is an extra-dimensional one that's mostly cut off from other dimensions, but has small attached pockets of other planes fused to it). The players managed to earn their trust by ridding the level of a cursed sword that was whispering corrupt suggestions to the Azer clergy. As a result the characters can interact with the Azer for food, items, and magic.
Another example happened on the 12th level of the Library. There was a decent size room where the Lich had bound some devils. The party defeated the devils and cleansed the room and when they checked their mapp found the room was a major choke point between the multiple levels. As a result they spent some time outfitting the room as a shelter and reinforced it so it's almost an underground keep. The characters have warded it and tend to fall back to it if they need to research, repair, or perform other downtime activities. This "keep" has become well known enough that it's attracted other residents of the Library that aren't thralls of the Lich.
So yeah they can work.