Place of application for temporary resident visa, work permit or study permit
(2) An application for a temporary resident visa — or an application for a work permit or study permit that under these Regulations must be made outside of Canada — must be made to an immigration office that serves as an immigration office for processing the type of application made and that serves, for the purpose of the application,
(a) the country in which the applicant is present and has been lawfully admitted; or
(b) the applicant's country of nationality or, if the applicant is stateless, their country of habitual residence other than a country in which they are residing without having been lawfully admitted
It means you can't apply for study permit in Canada.