This is not recommended at all! Unlike hard surfaces, like your floor, anything sprayed inside the ducts will be introduced into your home’s airstream and circulated throughout the house.
Only certain chemicals that have been specifically approved for cleaning the ducts must be used for this purpose. Also, these chemicals should only be used on non-porous surfaces.