From what I read somewhere, it is not illegal by federal law to posess a badge from another locality if you have it nowhere near that where it is issued. Like having a replica NYPD badge in CA - but CA probably has some law against it. Or an LAPD badge in NYC. State law varies.
These are usually used for real collectors and stage productions and such.
There is a real badge collector society and they collect the real deal badges. I saw Bufford Pusser's real badge at one of the shows. Most real collectors don't like the replica ones.
As stated, if you have issues with someone flashing a badge, ask for ID and then you can call the agency to verify. They should not have an issue with it and if they do, there is a problem anyway and it needs another officer on scene quick.
I was investigated by two SWAT guys in dumpy looking clothing flashing a badge in my face. I demanded ID from both and then contacted the PD to verify who they were, all while they waited outside on the doorstep. They were not too happy, but oh well. Too bad for them, get over the pain.
I was thinking about starting to collect badges. I have some patches already. In most places, it's easier to get a fake or replica badge than it is a uniform patch. Go figure.