Having done both, I would never varnish a wooden floor again, I oil them.
There is no varnish in this universe that doesn't scratch like heck, no matter how good your surface prep is (and painting, though not house painting, is my job, so I do things exactly by the book). Most of them will chip and flake as well. The best varnishes are usually spirit-based, and take ages to dry, which is a pain in the neck when you do them, and a pain in the neck when you have to patch up scratches.
I got sick of all that mucking about, so I asked a Danish friend what they do in Denmark, where they have a lot of wood floors. Apparently, they oil them. I sanded all the varnish off ours and oiled them, with a good quality floor oil with plenty of tung oil in it, even the kitchen floor. Would never, ever do anything else now. Easy to keep clean, looks fantastic (not glossy, but a lovely deep finish) and patching it up if it does get scratched is just a matter of rubbing a little oil in. There's nothing to flake, so no problems there at all.
Only downside- if you have valuable rugs, you need to put a suitable (non-slip) fabric under them to keep them off the wood and be very sure to leave the oil a few days first. But you generally have to have an undermat with a varnish to stop them slipping anyway.
Whether oil or varnish, I both sand and varnish/oil after decorating, though it does mean that I have to Henry and duster up all the dust very carefully after sanding. And I make sure any spirit based gloss/eggshell/satinwood has had a good week to dry before sanding the floor. I'm a bit unorthodox in that- most people would do as setthecontrols does. But I take a top-down approach to decorating- ceilings, covings, then walls, then woodwork. Then, of course, floors. Because gravity means drips and mess (though I try to avoid them) tend to go downwards.
With this exception- with a new solid wood floor, where I'd be using a wheeled floor sander, which is aggressive and I'd be taking a lot more off in order to get a perfect level rather than just sanding to get a tooth, I'd paint the final coat on the skirtings after the floor, sanding it at the same time as the floor.