Diesel engine situation is a little different. There is a normal ignition delay between the start-of-injection and the start-of-combustion which results in some portion of the fuel burning in premixed fashion which is responsible for the audible chatter of a diesel engine, but (A) it isn't the end-gas near the piston rings, it's in the vicinity of the injector - depending on how long the ignition delay is, (B) it isn't the entire fuel-air charge igniting like this, just a piece of it, (C) the charge is not homogeneously mixed at the time that this happens - so it doesn't all ignite at once. The normal ignition in a diesel engine starts with a rapid rate of pressure rise, but it should not be a detonation.
Diesel engines knock louder upon cold start because the ignition delay is longer.
Injection timing set too far advanced results in louder knock because (1) the temperature in cylinder is lower at the time of start-of-injection because the compression stroke isn't finished yet, (2) the longer ignition delay results in more fuel being in-cylinder and partially premixed by the time ignition happens. And yes, excessive ignition timing advance certainly can break stuff.
Newer modern-tech diesel engines are a lot quieter because the rate of injection is much more tightly controlled. It's not uncommon to split up the injection cycle into two parts - a small initial pulse that premixes and ignites followed by the main injection event that burns progressively.