I'm not entirely sure I understand the question. No, they can't legally do that - but yes, a bad cop can put a gun to your head off-camera and coerce a confession.
The comment I replied to claimed that the Fifth only protects you from testifying at trial. You said a coerced confession would be inadmissible, implying it’s still legal to do so, it just couldn’t be used as evidence.
The 5th amendment does not create any crimes, but every state has criminal laws that would apply to a police officer coercing a confession by threat, force, torture, etc....