This is Ontario: http://www.drivetest.ca/EN/licencing/Pages/How-to-Apply.aspx
It has a long list of ID documents that are accepted, including foreign passport. I can not make out from this page that there is a requirement to be a resident in Ontario in order to get a drivers license. Maybe there is although it does not say.
On the other hand, Alberta: http://www.servicealberta.com/1305.cfm says In order to obtain an Alberta driver’s licence or identification card, you must provide proof that you are lawfully entitled to reside in Canada (i.e. Canadian birth certificate, Permanent Resident Card, Citizenship Card, Canadian Passport) and proof that you are an Alberta resident (i.e. utility bills or other statements mailed to your Alberta address).
In BC:
Foundation documents
If you're born in Canada - Your legal name is the full name that appears on your birth certificate issued by a Canadian Vital Statistics agency.
If you're born outside of Canada - Your legal name is the full name that appears on your most recent immigration document issued by Citizenship and Immigration Canada.
Your most recent work, student or visitor permit,
Permanent Resident card or
Certificate of Canadian Citizenship (Note: We will only use the name that appears below the coat of arms).
in SK:
Entitled to be in Canada
To prove you are legally entitled to be in Canada, you must provide 1 of the following documents:
Canadian Birth certificate
Canadian Citizenship and Immigration Canada documentation
If you're only temporarily authorized to be in Canada, your Saskatchewan driver's licence will expire when your Citizenship and Immigration Canada documentation expires. A Saskatchewan driver's licence is no longer issued to someone holding a visitor visa.
Manitoba however, according to this table: https://www.mpi.mb.ca/en/DL/DL/Identity/Pages/acceptable-documents.aspx will accept a foreign passport with evidence showing that you are entitled to be in Canada which could be interpreted as such that they will allow a DL for a visitor who has a stamp in his passport although they may have more detailed rules about this and only accept a work or study permit.