Yes. You play an undercover cop throughout the story mode of Need for Speed: Undercover, so the police role is the premise rather than something you unlock.
The confusion usually comes from the older Hot Pursuit games, where you could switch between racer and cop in the same event. Undercover does not work that way. You are always the infiltrator, driving a civilian car and building a criminal reputation to get close to the target.
A Hot Pursuit title is the one to look at. That is the entry in the series built around playing both sides of the chase.