The dieseling phenomenon occurs not just because the compression ratio is sufficient to cause auto-ignition of the fuel, but also because a hot spot inside the cylinder (spark plug electrode, combustion-chamber/valve edge or even excess carbon) starts combustion.
If the injector is damaged or dirty, a small amount of fuel can enter the chamber and be ignited, causing a sputter or two after the engine is switched off.
Where the air contains flammable contaminants or additions, the temperature rise associated with the compression may ignite the mixture in a similar way to fuel in a diesel engine.
[1] While generally an unwanted phenomenon due to the effect on accuracy and also potential damage to rifle or sight, it is sometimes deliberately engineered by oiling the rear hollow base of the pellet or chamber, in order to increase the power of the weapon.
This is usually done as a stunt or in experimentation - the tiny amounts of oil involved makes consistency impractical, with consequent substantial adverse effect on accuracy.