Yes, the setup is compatible and you can easily install a 9-speed cassette on a 10-speed freehub and drivetrain of the rear wheels. the inner splines of the 9-speed cassette would easily install on the freehub bodies, but there are also major differences in the brands of freehub bodies, this setup is not applicable for all the brands of the freehub and cassettes, it is specific for a few brands which include Ultegra and 105 free hub body, both of these brands of 10-speed freehubs are compatible with the 9-speed cassettes but Dura-Ace and Ultegra WH-R600 And WH-6600 freehub bodies are not compatible with the 9-speed cassettes only Ultegra FH-6600 freehub is compatible with the 9-speed cassettes. this difference in hub and cassette compatibility is due to the differences within the splines and grooves of the cassettes which are compatible and non-compatible with the freehubs.
Chain Compatibility:
If you have a 10-speed freehub body and you are replacing your 10-speed cassette with a 9-speed cassette, then you can also use a 10-speed chain for the new setup o 9-speed cassette, it would not cause any problem or issue, chins of 9-speed and 10-speed cassettes are compatible with each other.
Difference Between 9-speed and 10-speed Cassettes:
9-speed cassettes are thicker and wider in nature than 10-speed cassettes, so you have to look for the cassette and drivetrain, if the cassette is wobbling and moving then you need a small-sized washer to install before the cassette, but if the setup is working the 10-speed freehub, then usually spacers are not needed and not installed for 9-speed cassettes with 10-speed freehub bodies.
spacers are usually for great 11-speed freehubs, if you are installing a 9-speed cassette on 11-speed freehubs then you need spacers and washers but for this setup usually, 9-speed cassettes do not require spacers and washers. 10-the difference between 9 and 10-speed cassettes is 1mm, 10-speed cassettes are narrower and thinner than 10-speed cassettes, and 10-speed cassettes are compatible with a 10-speed freehub body.
SRAM 10-speed and 9-Speed Cassettes:
The cog width of SRAM 9 and 10-speed cassettes have the same diameters and these have almost the same sizes, so you can easily swap, replace and interchange 9 and 10-speed cassettes with each other. but the space between the cogs and teeth of the 9 and 10-speed cassettes are different from each other for chain shifting from lower to higher to lower cogs.
9-speed cassette And 10-Speed Freehub Body For Mountain And Road Biking:
9-speed cassettes are easily installed on both road and mountain bikers without inserting any washers and spacers, but you have to choose compatible brands of freehub bodies and 9-speed cassettes. Shimano brands of 9 and 10-speed cassettes are also compatible with each other and you can easily replace them with each other on 10-speed freehub bodies.
Bottom Bracket:
The bottom bracket of 9-speed and 10-speed cassette bikes sometimes would cause an issue or problem by changing of chain lining, so you have to insert the spacers on both the drive and non-drive sides of the bottom brackets to be more accurate the lining of the chain, if the chain lining is not accurate then you will have to face with the poor shifting of the gears. the chains will skip and drop from higher to lower and lower to higher cogs of the cassettes.
Screws Of Rear Derailleur:
Derailleurs have two limit screws which are tightened and loosened for the lateral and longitudinal movement of the derailleur, and also you have to make the cable ratio of the 10-speed shifter compatible with the 9-speed cassette and freehub, for the proper shifting of the chain through the cogs of the cassette.
Wheel Compatibility:
The 10-speed free hub body has its specific free wheels with 10-speed cassettes, you also have to look for the compatibility of the wheel with the cassette and freehub.
Cable Tensioning:
Cable tensioning is called the cable pull ratio of the gear shifters, which can easily be adjusted through the screws of the rear derailleur, it is important because shifting of the chain from larger to lower cogs and sprockets is totally dependent on the cable pull ratio of the shifters.
Small Experiment:
When you have successfully installed the 9-speed cassette within the 10-speed freehub, do a small experiment by placing your bike on a floor stand or repair stand, and move the pedals at a speed, when the rear wheel is rotating, shift the gears of the cassette, and bring the chin in all the sprockets of the cassette, you can easily inspect and determine any issue or problem, but if the chain is rolling smoothly through without any noise and rubbing, then the setup is fine for riding.
Conclusion:
9-speed cassettes are comaptible with the 10-speed freehub, when the industry started manufacturing, cassettes of 7,8,9 and 10-speed, then these have placed the same widths for all of them, but 11 and 12-speed cassettes were different, and also 10 and 11-speed cassettes need spacers, 10-speed cassettes need 1.85mm of spacers with 10-speed freehubs and 11-speed cassettes need 2.85mm of spacers for installing them with the 10-speed freehub body.