It is legal, though I can only speak to US law. Its just that the police can take it as evidence, and that makes the task of making it 'disappear' pretty simple. Some jurisdictions also require the officer to be made aware of the recording as it goes on.
The policeman is likely to be saying something. And his focus is on the victim, and therefore unaware of the recording. So do we still think that should be illegal to record?