Depend on your status ,if your I-20 of F1 still valid,& you neve
quit your cause,then you may apply a new F1 visa in Canada or Mexico,no matter your current visa is valid
or not,but if you already out of status,you can't apply
a new visa in third country unless you have a PR in that country.