NYPD Licensing

I was watching an episode of Blue Bloods when I started thinking about licensing.
I remembered the last time I flew out of JFK, I bought a tank top with the NYPD logo. I also remembered reading somewhere that the NYPD makes money on licensing their logo for such products.
So I started wondering if a show like Blue Bloods have to pay licensing fees to the NYPD as they use the actual NYPD logos and uniforms etc.
I googled it and was surprised to find the answer was yes. I can understand a t-shirt, but I thought perhaps art/entertainment had some kind of free to use depictions of government departments.
According to the article linked above, this is mainly because Blue Bloods try to be as accurate/authentic to the NYPD look as possible.
So now I’m curious, have other shows paid licensing fees? Did Hill Street Blues pay the NYPD? I can’t remember if the logos were the same, and I can’t recall how accurate authentic the uniforms were.
Or what about Brooklyn 99, a comedy, arguably a parody of the NYPD. Aren’t parodies considered a humorous commentary and so do not need to pay any licensing fees?
What about other police departments regularly depicted on TV or film, like the LAPD, CPD or the FBI/CIA?
And what about the military. Considering all the war films, is there a licensing required when TV/Film makers use actual unit logos in film?
Finally, what about internationally? Is this uniquely American? Or are there licensing requirements in other countries. I have certainly seen plenty of TV/Film featuring, the Scotland Yard, Interpol, Canadian Mounted Police, MI6 etc.
This turned into multiple questions, and therefor have a possibility for multiple answers, so not sure if this belongs elsewhere, but I’ll start it in GQ for now and let the moderators decide if it should be moved.