I understand that since Minecraft 1.13 the block cave_air has been used to represent air blocks in caves. If I want to fill caves fully (or just identify caves accurately) is it safe to assume that the only blocks I need to identify/replace are cave_air blocks? If not, what are the conditions that might lead to a different block being used to fill a cave by the worlds generation algorithm?
Yes it should be safe to assume that the only blocks you need to identify/replace are cave_air blocks.
The only other blocks that can spawn in caves are lava or water. Usually it happens when random generation generates lava or water and deliberately puts a cave to hold it. Other options are if the water from the sea connects to a cave and floods it, or lava overspills into another cave.