There is a unit called a turbo charger in all diesel locos. This unit mixes air with the fuel, and the mixture is fed to the diesel engine. When an ALCO is suddenly accelerated, the turbo charger is unable to supply enough air.Because of this the fuel is not burnt properly and comes out through the exhaust. When this fuel in the exhaust mixes with the air outside, it ignites and you can see flames in the smoke.
EMD locos also have this issue. For EMD locos, usually all the soot and carbon that pulls up in the exhaust, ignis when the engine is started up and flames will be visible for a short while.