A: Before you can bring any of these locations into your game, you must answer the questions of "who" and "why". Who was it that built and inhabited the location of your next adventure? Was it some old wizard from a millennium ago? If so, what kind of wizard were they? An evil lich slain long ago brings to mind different thoughts than some crazed arcane experimenter or a noble protector of the realm. It may have been created by an old lost monarch. You might have the same thoughts here, what kind of a ruler were they? This will inform not only what kinds of rooms may be in your locations, but the kinds of descriptions and objects your players will find in these places. You might also consider why it became abandoned. Plague? Large scale battle? Natural Disaster? Any of these different scenarios can help you alter your descriptions for these places. They may also inform you how the surrounding landscape has changed. A farming village with a manor house hit by a plague may have wild overgrown plants, possibly even with plant based creatures having developed. The descriptions of Thundertree in Lost Mine of Phandelver are a great example of this.
Another thing to consider in the “who” and “why” categories would be the time period between when the pace was abandoned and when your adventuring party is visiting. Did goblins live in a village for a while and befoul the place? Did giant birds start roosting in the remains of an old starship where everyone was turned to stone? You can easily see how both of these scenarios change the way you would describe the dilapidated ruins to your characters. It might even be just as interesting if the ruins aren’t dilapidated. If they aren’t, what kept them from going to spoil? Who did it and why? Even with pre-written adventures, taking some of these questions under consideration can drastically change how you present the story. If we've answered some of these questions for ourselves, we can move on to actually playing around in these locales. Bugsy, how do you go about presenting these “dungeons” to the players at your table once you’ve decided a little something about their histories?
B: Like most of D&D's first incarnation, dungeons were "borrowed" from Gary Gygax's favorite fantasy series, Conan the Barbarian. (Not do downplay influence of mythology on both creators, or course.) But, given how much closer D&D was to a wargame at that point, they didn't borrow the complex histories Robert Howard gave Hyboria. Dungeons were designed around the challenge they present to the players, and it was only later editions that expanded their nature.. slightly. Not to say that a design shouldn't be based around the scenarios you want to run and the difficulty curve you want to offer your players, quite the opposite - play and interaction should always come first. The trick to share detail that inform and establish that play.
As Andy said, the "who" and "why" are central, here. Let's start with the second. Was this somewhere people lived, where complexity grew organically with changes in population, technology, and resource availability? You'll want to convey that, regardless of their current condition, the various routes were made for travel, and that different places had specific (if possibly shifting) purposes. The town square may have once been a marketplace or arena, or maybe served as a makeshift hospital in times of plague. It's important to remember, though, that, with the exception of immediate catastrophes like the destruction of Pompeii, cities and towns aren't abandoned all at once, and tend to suffer gradual decay as the population dwindles. As such, if you want to convey an abandoned city while still presenting the players navigational complexities, you can incorporate collapsed buildings, blocked streets, and other obstacles on top of what may already be an obtuse layout. Clues indicating the city's fate can be scattered among the debris, such as valuable artifacts found in close, tight, tenements, which might indicate the wealthy fled quickly, leaving their finery behind to be looted, or that their districts became uninhabitable for some reason, and they forced the poor from the city to take their housing. You don't need to provide the full story, but details like this can get the players speculating about what happened, and thus more involved in the setting.
If the PCs are going somewhere beneath a city (whether abandoned or still-inhabited), such as sewers, remember that these still tend to follow the basic layout of roads and housing as the land above ground... or, at least, how it was when the underground structure was built. There's a reason, after all, that the "underground tunnels of the Old City" is a classic trope, offering the discovery and exploration of an abandoned place in proximity to a modern space. In any case, if you're looking a quick way to layout a cityscape, there's certainly nothing wrong with stealing from history. One great source for historic maps is Old Maps Online, a searchable database of maps owned by museums and schools. Naturally, this is an even better tool for those running historic games in real-world settings.
Speaking of which, it's worth it to consider the effect on the current economy of all the treasures being plundered from long-gone civilizations. If they stay within the local market, there could become a glut of antiques that become less valuable with each haul. But if they're being exported, how does the influx of money affect the local economy? Does the processing of artifacts become the only viable activity for the locals to engage in. The manga and anime series Made in Abyss depicts a community in just such a circumstance, where the town on the edge of the titular Abyss is focused entirely on training people to delve for artifacts, processing and exporting those artifacts, and selling provisions to any outsiders who want to try their hand at "cave raiding." In any case, you should always bear the significance of holy artifacts in mind, which might include anything found in a temple - since many of the gods in D&D exist within that universe, it's probably a bad ides to risk getting on their wrong side!
Again, none of this needs to be the adventure's focus. (Although, if something seems interesting and gives you ideas for development, it certainly can be!) But keeping these things in mind when designing a location can help to make things consistent. From the stuff the PCs stumble across to descriptions of architecture and murals, each detail should include a little bit of that place's story. Not only will this help flesh out the setting and keep the players engaged, it also reminds them that they are only a small part of a larger world: one of glories and tragedies, of peoples present and long-gone, of stories concurrent and enshrined in legend. As for whether they, too, will become part of that legend... that's for those at the table to decide.