It is not legal if you are driving in the USA with a foreign license, because the license is not valid in the US. You will need an International Driving Permit (IDP), which translates the information on your driver’s license into ten different languages, so people from other countries will understand. However, the US does not issue international driving permits, so you will have to obtain one before you leave the country, or before getting to the US. In the event of an apprehension, you will probably be asked to produce both the IDP and your original license. So before driving in the USA with a foreign license, make sure that you have received an international driving permit first.