Generally, a voluntary statement to police isn't immediately illegal, but its use in a trial is a complicated matter. The vital factor is whether it was obtained fairly. Police must adhere to specific rules, including https://panchanandshaw.com/blog/counter-claim-explained/