You can apply but it may be processed from your country of citizenship. You need to show ties to return, career advancement in home country to justify costs, education advancement, funds etc. Applying from within Canada weakens your application. Only certain scenarios are processed inland.