Learning to Fly in the USA
AOPA website says:
According to INS regulations, Title 8 of the Code of Federal Regulations, Section 214.2(b)(7), any alien who is permitted to enter the United States on a B-1 or B-2 visitor's status visa is prohibited from enrolling in a course of study. Such an alien must an either obtain an F-1 or M-1 non-immigrant visa from a consular officer abroad and seek readmission to the United States, or apply for and obtain a change of status under section 248 of the Act and 8 CFR part 248. The alien may not enroll in the course of study until the Service has admitted the alien as an F-1 or M-1 nonimmigrant or has approved the alien's application.
For Part 61 training:
For instance: college students or those here for temporary employment.
Part 61 flight schools and independent flight instructors may train a foreign national if that alien is a legal permanent resident or in a work status (H-type visa) with extended stay privileges or a refugee in asylum status with appropriate DHS documentation. They also may train a foreign national on an F-1 (academic visa) provided that the student is still enrolled and attending the college or university as shown on the F-1 and the student has notified SEVIS of the additional training being received at a non-SEVIS approved school.