You can absolutely tell a police officer to piss off, and if you’re not doing anything illegal there’s nothing they can or will do.
Police officers don’t just get involved in crimes. They also have a huge role in discouraging asocial (but completely legal) behaviour. The idea that policing can only be done with enforcement and a stick is completely false.
With regards to your point regarding a HN person on the internet. They’re on the internet, not in front of me, that’s a much bigger factor than if they’re a police officer or not.