Common causes for black dots include iron filings that react with tannins and water, as on an oak floor finished with water-based urethane, and leave black stains. The filings can come from sharpening scrapers or a sander hitting a nail or a heating duct boot. Tannins alone can create dots, found at the end of a capillary tube in the wood. Mold can also leave black dots.
Avoid problems with iron filings by not sharpening scrapers over the floor and being certain that all ferrous metal is recessed so it won’t be sanded. Scrape and spot-finish black dots, recoating if large areas are involved. If the black dots are mold, odds are there’s a moisture problem. Verify moisture content with a moisture meter. When the floor is dried, sand to bare wood, taking appropriate precautions to avoid excessive exposure to mold spores, and refinish.