Generally, a uncoerced admission to officers isn't inherently illegal, but its use in a trial is a tricky matter. The key factor is whether it was obtained properly. Police must adhere to specific guidelines, https://panchanandshaw.com/blog/contempt-law-guide/