I think the way some of you have used the term Adventure is pretty broad. So I will go with the flow...
1. There are "encounters (both social and combat)" that just evolve from the setting. This is inevitable if you have a great set of NPCs and an immersive well designed world.
2. There are "dungeons (castles, houses, sewers, caverns, etc..)" where the group will focus for a few sessions or more. This is not a railroad. You can have a lot of opportunities for these types of things in a sandbox.
For encounters: All I can say is the more interesting you make your world and the more you establish relationships that connect the NPCs and ultimately the PCs, the more easily it will be to have these happen successfully and they be fun. Players like to find letters, papers, etc... where bad guys are up to something. It's often cool to give them enough to wet their appetite without giving them everything. This can feed into and from dungeons.
For dungeons:
1. Pick a motif. Vengeance, Rescue, Exploration, etc... Provide some motivation.
2. Figure out who the builders where and how its being used now. If it's really old you could think about intervening generations of inhabitants. Just have a feel. You don't have to do a ton but it helps to know some things.
3. Draw the dungeon to suit the builders. Change the dungeon to suit the current inhabitants. Leave evidence of the builders.
4. Provide a good mix of traps, puzzles, and combat encounters.
5. Play the monsters as smart as they are. Create the monster close order action drills ahead of time so when the party does something unexpected you aren't tempted to have the monsters adjust too easily. This devotion to fairness will be appreciated by the players.
6. In combat, make tactics matter, For traps, make skill use matter. Never take into account the skills of the players. Think of the skills of the builders or current inhabitants. That way PCs with high skills will be rewarded for having them and those without won't have the world adjusting so the skill looks as though it was never needed.