The temperature at where E coli bacteria dies and is killed is 160 F so when you bake foods the E coli is killed.
As long as you bake the food all the way through and make sure the baked goods are fully done the E coli will not be able to survive in those hot temperatures.
So yes E coli is killed in the baking process.
If you eat raw flour, raw cookie dough, raw cake batter etc you could possibly get E coli poisoning.
However the risk is small but I still would avoid eating any raw cookie dough, raw flour, raw cake batter etc just because it's not worth the risk of getting E coli poisoning.