Your wife can apply to sponsor you for Canada PR but she must be living in Canada to do that. If you can get a visa to go to Canada, you can go with her. If you want to wait in the US, you can do that.
If you originally had at least a 1 year visa to enter the US but have since overstayed, your wife can pick Buffalo as your visa office and you will definitely not have to go back to your country. If an interview would be necessary, it would happen in the US. If you never had a 1 year visa or longer in the US, your wife must apply to sponsor you through your home country but it is not certain that you would have to go there. If there is no interview required, you can stay in the US the whole time.