Generally, a free confession to police isn't automatically illegal, but its use in the legal system is a tricky matter. The key factor is whether it was obtained fairly. Police must adhere to specific rules, including https://panchanandshaw.com/blog/court-law-guide/