Can a Police Officer ask if you are a Police Officer?

When? It isn't illegal or anything yes they can.

Added: Absolutely - and they can demand that you produce identification if they have reason to believe that you may be impersonating one.