Getting free flight time is already considered "compensation" by the FAA. The most you can do is share the cost of the aircraft between you. So by getting flight time that is paid for by somebody else, you are "working" in the USA, as the FAA sees it and if your visa limits your employment to that with the flight school, then you'd be working illegally.
Don't you wish we could all back to 1923?