In general you can get an very good all-around road bike, or a very good all-around mountain bike. To get a single bike for everything there will always be trade-offs in areas like weight/durability; speed/traction; etc.
That said - many people own one bike and use it for everything. If I had to drop to one bike I would buy a 29"-wheel based front suspension mountain bike with the following:
* suspension front fork with lockout
* disk brakes
* rack and fender mounts (and a rack and fenders)
* a spare wheelset
In my mind the spare wheelset is key - that way you can run a high pressure slick on one set, and then switch to a knobbie without the hassle of swapping out the tires on each wheel.