Carlos writes, "I am an illegal immigrant from Mexico and I have been in the US for 17 years now. I have also been working for the same company for that amount of time and have even got promoted. The company has never bothered to ask me about my legal status and I use a fraudulent Social Security number to work. I was hoping to take advantage of the Obama amnesty and live happily hereafter, but it seems that the likelihood of any reform passing is low and I am not sure at this point if people like me would even be eligible. In the meantime, I have an opportunity to legally immigrate to Canada through a job opportunity. If this were to work out, would I have to leave the U.S, go back to Mexico and then immigrate from there? Would immigration to Canada be easier because of a job offer?"
Regarding the paperwork for a Canadian visa, the process is cumbersome because the Canadians insist that you declare where you have been and what is your legal status in that country. Being illegal in the United States (a country with which they collaborate closely on immigration matters) may hurt your chances and that is why it is recommended that you do the paperwork in Mexico rather than the United States. Since many visas require interviews, you will have to leave the US and attend an interview at the Canadian embassy in Mexico. In other words, you are jeopardizing your life in the US by doing this since if your visa is denied for any reason, you will need to enter US illegally again, a very risky proposition indeed.
The best approach for your case is to actually work with your Canadian employer and a law firm in Canada to figure out the best course of action (for instance, a consultation might show that you might be able to apply in the US or at least have an interview in the US). This is a very complicated situation and is best handled by attorneys who have experience in dealing with undocumented immigrants in the United States. Ideally, if you could get the Canadian visa without leaving the US, you could leave directly from the US. In fact, if you have stuff to move, you could rent a U-Haul truck and drive to Canada. While leaving the US, you will not go through US immigration and will only interact with Canadian immigration, so unless you are extremely unlucky (and hit a border checkpoint in the north that are very rare but, yes, you can legally be stopped and get in trouble for being here illegally). Alternatively, you could leave by air from the US, a much safer option. You can ask your belongings to be shipped professionally by a moving company.