Yes. What matters when you are getting divorced is where you live at the time you are getting the divorce. Where you got married almost never matters. You are not entitled to get divorced in Ontario if you have not lived in Ontario for one year – even if you were married here.
For a Canadian Court to grant a divorce one of the spouses must have lived in the province granting the divorce for one year. If you have not lived in Ontario for one year, then you have to wait to get your divorce. That is on top of the requirement that you and your spouse be separated for one year.
It is possible that Canada will not recognize your divorce if you get divorced in place where neither spouse is living. That is true even if you go back to the place you were married. If you get divorced in a place where neither spouse lives, you may have to go to court in Ontario to have your divorce recognized here.