For the high-speed atmospheric entry, there are specialised facilities called arcjets (sort of a high speed plasma wind tunnel) in which samples of the heatshield material can be tested. For the rest, the CO2 atmosphere is not a problem for the materials we use, but rather the temperature, low pressure, dust and ultraviolet light from the Sun. In general if there’s a material that would react chemically with the Mars atmosphere then it would do so also with Earth’s atmosphere and we wouldn’t choose it to start with.
Actually there is so little atmosphere on Mars (only 1% of the pressure of the atmosphere here on Earth) for a lot of tests, we just use a complete vacuum, as that is a close enough approximation. We know the composition of Mars’ atmosphere (mostly Carbon Dioxide, with some Nitrogen, and Argon, with traces of other gases) doesn’t have anything very different or unusual with respect to Earth’s atmosphere, so if the materials that we are using are stable in Earth atmospheric conditions, and under a vacuum, then probably it’ll be fine on Mars which is a bit like a combination between those two.
We do use the correct pressure and mix of gases to replicate the real atmosphere on Mars for the thermal tests that we do, as the composition of the atmosphere makes a difference to the way heat exchanges between the rover and its surroundings, so it needs to be accurately represented for those tests.