What should you do first paint ceiling and walls or strip and finish hardwood floors?
My general rule is that paint should generally be one of the last things that you do.  Refinishing a floor can make a horrible mess, and dust from sanding is going to end up all over the place. It's probably going to be easier to clean up from the floor job before prepping the walls and ceiling for painting than it would be to clean up freshly painted walls.  Also, if you're taking any of the trim off (i.e. shoe molding) to do the floor the finish will look a lot better if it's done in one go after it's reinstalled.

As for getting paint on the refinished floor, interior latex paints are incredibly easy to clean off of a newly finished floor (even after they've dried). Not as much so on bare wood.