Many years ago, doors were built using only wood boards and hand forged nails, the nails were long enough to nail the vertical wooden panels and horizontal stretcher boards securely together and protrude out the back.
By pounding the protruding point of the nail over and down back into
the wood it was almost impossible to pull out and said to be dead.
It was called dead, because it could not be used again. This
technique was called clinching the nail.
So the saying dead as a doornail became to mean can't be undone.
Also clinching something means finishing it.