I don't know whether it is illegal or not. I can tell you why I wouldn't do it.
You will tick a cop off who will accuse you of trying to impersonate an LEO. Whether or not he can make such a charge stick, he can make your life miserable for a while--and there is at least one out there who will go out of his way to do so.
You would be asking for trouble.