A lot, but a lot of the advancements in things like engine and aerodynamic efficiency come from racing.
They need to have efficient designs so they don't have to stop in the pit for fuel, tires, etc. as often because every second matters in a race. That translates to efficiency gains across engine design in general. Whether that is more efficiency in getting power out of the fuel, getting the power to the wheels, making the engine itself lighter without losing structural integrity, etc. All of that makes its way back to both commercial and consumer designs.
The pinnacle of engineering moving upwards also pulls the average up along with it.
Even if we add it all up though, peak professional racing like this produces a tiny fraction of the CO2 released everyday by international marine shipping. Hell, burning bunker fuel in international waters where there are virtually no environmental protection requirements probably produces more CO2 in a month than all of international racing in a year.
These companies spend a lot of money on advertising, propaganda outlets, astro turfing online, etc. and want us to think about stuff like this instead of the things that actually cause the most issues by volume. Just like States like California talking about people saving water due to drought, instead of having farms reduce planting insanely inefficient crops like almonds that need 8 gallons of water per nut to grow. Or allowing Saudi firms to grow alfalfa, one of the most water intensive crops, in Arizona.