You do not have to go to Mexico to apply through Mexico City unless they call you for an interview. I applied through the London office, yet never had to go to London because they did not require me to take an interview.
If you came in on a legal visa, contact the Buffalo office at
http://www.cic.gc.ca/english/information/offices/missions/buffalo.asp and ask them if you can apply through there. Otherwise you have to do your application, send it to Mexico city and hope they will not ask you to interview.