Before, if you can. An empty house means unobstructed access to every register, no furniture to work around, no pets to manage and no schedule to coordinate, the job goes faster and cleaner. It's also the moment you learn what you actually bought.
An inspection at this stage is genuinely informative. You find out whether there's mold at the coil, whether there's rodent evidence in the attic runs, whether ductwork is sagging or disconnected, and whether the system was maintained at all. Discovering that in an empty house, while you still have leverage and no furniture in the way, is much better than discovering it in August.
Previous owners with pets or smokers, a home that sat vacant for a long stretch, any known water damage or pest history, an allergy sufferer moving in, or an older house with no maintenance records. In those cases the previous occupancy is still in the ductwork, and you're about to start breathing it.
If you're doing renovation work first, painting, flooring, anything that generates dust, do that first and clean afterward, or you'll be paying for it twice. Same logic as new construction: clean once the dust-producing work is done.
Only with the current owner’s permission and access. Most buyers schedule it for the window between closing and move-in.
Talk to your landlord or property manager, in a rental, duct condition is generally their responsibility to address.