There are many restrictions and requirements related to international travel for those who are in the U.S. in non-immigrant status as well as those applying for permanent residence. Unless you are a United States Citizen or Permanent Resident, it would be wise to consult an immigration lawyer before traveling abroad.
H-1B and L-1 Nonimmigrants
With the exception of certain Canadian or Mexican citizens, nonimmigrants entering the United States require a visa, which is a stamp in one’s passport or international travel document by a U.S. Consular Officer. Applications for visa stamps must be made at the U.S. Consulate or Embassy outside the United States.
Where do I apply for a Visa?
You can either apply at the U.S. Consulate or Embassy having jurisdiction over your residence in your home country or as a Third Country National in a country other than your home country.
In my home country:
Applying in your home country is generally the best option. You will usually have better access to documents required or requested by consular officers when you are physically close to home. You should allow yourself ample time to apply for a visa before reentering the United States. Since each post has its own procedures for processing visas, you should contact the appropriate U.S. Consulate or Embassy in advance for its current requirements and visa issuance times. The Department of State website lists all consular posts that have websites.
In Canada or Mexico:
When it is not feasible to apply for a visa at the U.S. Consulate or Embassy in your home country it may be worth considering applying at consular posts in either Canada or Mexico. However, if you travel to Canada or Mexico and attempt to obtain a visa at a U.S. Consulate and if in the Consular Officer’s discretion you are denied that visa, you may not reenter the United States under the "automatic revalidation process”. You must go directly to your home country and obtain a visa at the U.S. Consulate there before you may reenter the U.S. Many posts restrict the processing of Third Country Nationals. Moreover, you could be denied a nonimmigrant visa at a U.S. Consulate or Embassy other than the one in your home country if you are found to have overstayed your authorized period of stay in the United States. This requirement may not be waived unless there are “extraordinary circumstances” to warrant a waiver.
Before you invest the time and expense to attempt to schedule a nonimmigrant visa appointment at a U.S. Consulate or Embassy in Canada or Mexico, answer these questions: (1) are there any bars to my eligibility to apply for a nonimmigrant visa, and if not, (2) will I need a visitor visa to enter Canada or Mexico?
If you have not previously overstayed a nonimmigrant visa and no other potential issues of inadmissibility exists (such as a criminal conviction or prior finding of inadmissibility), you should next determine whether you need a visa to enter Canada or Mexico.
Permanent Resident Applicants
If you have a pending Application to Register Permanent Residence or Adjust Status, you should carefully examine your situation and ideally contact your immigration lawyer prior to making any international travel plans.
The U.S. Citizenship and Immigration Service filing fee for Applications to Register Permanent Residence or Adjust status include an Application for Advance Parole. Most aliens need Advance Parole to reenter the United States after traveling abroad if they have pending applications for immigration benefits. However, if you are an H, L, V or K3/K4 nonimmigrant, you must present a valid visa upon reentry to the United States.