You can do the fretwork after the finish, but it's risky. Fretwork requires some sharp tools and occasional bits of applied violence. And a finished neck is rounded and hard to hold on to. So there's a big risk of denting or scratching the finish. It can be done, but you have to be careful.
These days, I normally completely finish the fretwork before I even finish shaping the back of the neck. The neck is cut to width and thickness profile, the fingerboard radiused and slotted, but the neck is still rectangular on the back. That makes it a whole lot easier to hold on to in fixtures and vises. And no worry if I get a ding or scratch. From there, I put in the surface and side dots, sand and polish the fingerboard, coat it with Stew-Mac's Fingerboard Oil, and buff it out. Then comes the frets; installed, leveled, crowned and polished. I mask off the fingerboard to protect it, shape the back of the neck, and get it all sanded out. Before painting, I'll usually pull the masking and check the fretwork to see if anything moved during the shaping. If necessary, I can do a light re-leveling. Then it gets masked up and painted.