You would usually caulk the gap between the baseboard and the wall. This is why I usually don't bother painting the trim before putting it up (unless I'm staining it).
Usually I would prime the wall first, then put up the trim, putty/caulk, paint the trim, then finally paint the walls.
First, a quick note on technique - start with a coarse grade sandpaper on the floor sander and work down to the the finer grade.
The coarse grade removes the old finish and levels out the imperfections, then the fine grade makes it nice and smooth. If you go the other way around, you'll definitely curse every time you see the grooves in the sunlight. Fixing this means stripping off the nice new finish, not fun.
In passing, an obvious-in-hindsight but sometimes-missed point is to go with the grain, i.e. sand along the boards, not across them. In any case your sander will complain bitterly if you don't.
Also, give the boards an incredibly good wash before you start with e.g. Sugar Soap - you want to try and strip off everything gungy to stop the sandpaper clogging too often. Leave for at least 24 hours to dry nicely.
Be sure to hire an "edge sander" too, this will help you get to the edges that a drum sander won't get to. If you can, remove the skirting boards (baseboards) as then you can get right underneath; only do this if you know you're redecorating the walls too and don't mind patching up the woodwork. You'll inevitably end up doing the fiddly bits around the door frame and right in the corners yourself by hand with a scraper or sandpaper, which takes longer than you could possibly imagine.
While doing the sanding, remove everything from the room (obviously) and get heavyweight dust sheets to tape around the door. Wear airtight goggles as this is an insanely dusty process. You'll also need ear defenders as this is an insanely loud process too.
Regarding stain, it's a matter of personal preference. I've done both and prefer the more uniform result that stain gives.
Regarding finish, I've used both oil-based and water-based finishes. Both are OK, but the oil-based one looked richer (can't say why, can't say how) -- and took about three days to dry. Somewhat inconvenient for a hall, and our puppy left nice pawprints.
Follow the instructions on the tin; in general thinning probably isn't worth it, as you'll find the second and subsequent coats will go further anyway. I applied three coats of the oil-based finish, and five of the water-based finish, but this depends on the state of your boards. It's handy to rent good bright work lights so you can see where you've been, especially for the second and subsequent coats.
What is important is that you get flooring-grade varnish, regular varnish won't stand up to the first party, and yacht varnish will cost so much you won't have the first party...
Best Answer
Sure. Why not? If you have a brad gun with headless pins, they leave a hole that would be almost undetectable from a few feet away anyway. With a little care about where you place the pins, you might even skip the step of filling the holes, certainly so those in baseboard and possibly in ceiling trim.
For trim at eye level where it may be more critical to hide the holes though, the right color wax crayon used for filling nail heads will do wonders. You can buy them in wood colors for this purpose. Rub a little in, then clean the surface with a cloth or your finger.