Everyone must obey the law, including the police, but there are laws that give police special powers to do things that are illegal for other people, and even then police can use these special powers only in some circumstances: while they are investigating an offence or enforcing a law, and only if they have special permission from a superior (except in emergencies), and only if they reasonably believe that “breaking the law” is appropriate in the circumstances.
Police Powers
Can police break the law?
Police are not allowed to violate your Charter rights.
Charter rights are guaranteed to everyone and cannot be limited except in circumstances that justify a reasonable (fair and proportionate) limit.