First Carbon + Carbon makes Magnesium, Neon, or Sodium. It's Carbon + helium that makes Oxygen.
Secondly, it's not true that all carbon is converted into oxygen. At the end of core helium burning (where carbon is converted into oxygen), the core will have about 30% carbon and 70% oxygen. In massive stars, most of the carbon will then be converted into heavier elements as the star approaches core collapse. But some carbon can survive if it's near the outer edge of the core and thus does not reach carbon-burning temperatures. The star will also make more carbon in its helium shell, which is outside of the core, which can survive until the star explodes. Once the star undergoes a supernova the remaining carbon can be ejected into the Universe.
There is also another option, in stars ~40 times the mass of the sun the stellar winds can be strong enough to remove the surface layers of the star and expose the helium-burning core. That core is rich in carbon (as we are converting helium into carbon) and thus carbon can be ejected in the strong stellar winds of massive stars.