You can be criminally inadmissible to Canada whether you committed a crime in Canada or abroad, however, there are options to overcome criminal inadmissibility.
People who commit crimes outside Canada become criminally inadmissible as soon as the charge is laid, but this is not the case for offences committed within Canada.
You only become inadmissible for a crime committed in Canada when an actual conviction takes place and not before. This is thanks to phrasing in the Immigration and Refugee Protection Act which makes the distinction between “committing an act” that constitutes an offense and a conviction for an offense.
When someone receives a charge outside Canada for committing an act that constitutes an offence, they may become immediately inadmissible.
While a charge is pending you can still travel to Canada, but if convicted then you may not be able to. Fortunately, there are options for people to overcome criminal inadmissibility.