And the above example has nothing to do with energy being created or destroyed. Energy can, & does, get converted to different forms of energy, which is exactly what is going on here.....
Chemical energy [ burning mixture ] gets converted to heat, which gets converted to mechanical energy [ force on piston crown ]. There are always some losses with energy conversion, but it is not destroyed.