J1
It is allowed to work on a J1 visa but the flightschool were you did your training acts as a sponsor. This means they have to approve were you are going to work. There is a restriction though officially you're only allowed to work 20 hours a week. The work you do is purely for building experience to an ATP level which is 1200 hours. So the Visa is absolutely not a work permit. The maximum time you're allowed to stay in the US is 2 years depending on the program you're doing. After this two years you have to return to your country of origin.
Another restriction is that it's only applicable for persons who have less than 50 hours of flight-time after getting their PPL.