Visitor can only apply for a drivers license if they are issued a Visitor Record (IMM 1442) document from immigration.
A visitor can only swap their home country's license for an Ontario license from the following countries: USA, Australia, Austria, Belgium, France, Germany, Great Britain, the Isle of Man, Japan, Korea, Northern Ireland, Republic of Ireland, Switzerland, Taiwan.
From any other country, they would need to go through the system same as a new driver to get an Ontario license.