Yes, the CMB could be partially absorbed by dust or other galaxies that are now in front of it, however, since we know the spectrum should be a black body spectrum. We can, for a certain point on the sky, measure the CMB at various wavelengths and see what temperature black body spectrum would fit this data best. Thus people can make these famous maps where you see the temperature of the CMB radiation fluctuate slightly at various points in the sky. Even though there is indeed quite some noise on top of the CMB signal nowadays we can filter out the noise since the noise itself doesn't typically follow a black body spectrum with the same temperature as the rest of the CMB.
But how can we be sure most of what we see on these maps is actual signal rather than noise? From calculations which predict the distribution of elements in the universe one can show that the amount of photons that was emitted as this leftover radiation was so intense that in the early universe (when the CMB still had a black body spectrum of $T=10000K$ instead of the current $T=2.7K$) all energy from the CMB was so intense that it dominated the total energy content of the entire visible universe. Try to imagine that! An enitre Universe, filled with radiation of thousands of degrees.
This makes us pretty confident that the couple of photons emitted or absorbed after the initial emission of the CMB doesn't change the main results. Though there is a whole branch of physics specializing in removing the noise to observe smaller and smaller structures of the CMB.