Great question — answering as the UphillTech team:
It is possible to apply online for a Canadian visa from any country where you are present legally. Justification needs to be stated but it does not have to be the emergency or necessity kind. Due to various travel restrictions and visa processing timelines during the Covid pandemic, doing this might be faster than applying in one's home country. But is it allowed? Note that in general, most applications are processed online nowadays by central or delegated offices in Canada and around the world, not the consulates directly. It might be faster if there is significant difficulty in obtaining a VAC appointment for biometrics collection in your home country; or a significant load of the visa...
Full answer by xngtng: https://travel.stackexchange.com/a/171869 (CC BY-SA 4.0).
Need it done for your business? UphillTech.