If it's your injectors leaking, the loud knock is coming because the piston is trying to compress a liquid fuel rather than a gas fuel/air mixture. Since a liquid is not compressible, it's like the piston is hitting the cylinder head when it comes to the top of its stroke. The danger is that you can damage something. It's a serious condition, so fix it...don't mess with driving it around. Sometimes a glow plug tip can come off and rattle around in a cylinder, also producing a loud knock.