When the CMB temperature is calculated does it take into account photons absorbed by gas clouds and dust over billions of years?
If you receive CMB photons then those photons haven't been absorbed.
The CMB spectrum is modified by absorption and emission (mainly) along the line of sight. Particularly due to dust in our own Galaxy and even in our own Solar System. These are small perturbations and are taken into account when analysing the CMB.
Only a tiny fraction of CMB photons can have been absorbed. There are about a billion photons for every proton in the universe and that ratio is thought to be very similar now to what it was when the CMB was produced. Even if every atom in the universe could somehow absorb a CMB photon (they can't and most protons are not in atoms) this could only remove one billionth of the photons.