on the ar-15/m16 the headspace in on the barrel extension. the barrel extension threads on the barrel and is set to a standard HS if the barrel is properly set up.
to change the headspace on a barrel/barrel extension you would have to remove the set pin and tighten or loosen the barrel extension to get the correct space, then re insert the barrel pin. the downside is if the gas port is drilled it is now going to be "off".
Hess/Vulcan and SARCO have shipped barrels with the gas port off that was either welded over and re drilled of just left canted. pretty messy job to clean up a furbar. it is usually cheaper to replace than fix it.
a new barrel and a new bolt will work perfectly (mostly) and a new bolt and a used barrel are generally OK , a used barrel and a used bolt from another set up may be out--
generally it pays to check them all. the modular AR/M16 will generally have the HS on the money PROVIDED the makers stuck to the blueprint specs for the barrel/bolt. 99.5% of the time they do on s USGI type build.
on match type builds sometimes the chamber has to be honed cause they will set the HS to standard but leave a overly tight chamber for the smith to finish.
some makers on exotic conversions like 6.5G and 6.8SPC have used a not standard HS on the bolt and the extension.