If I take a training course from Sun microsystems by paying them when I am on H4, is it illegal?
Technically, before October 1st - there is no employee-employer relation. It can be a trainer-trainee relation like Sun example above.
Also, please don't forget to consult a good lawyer when you have any questions about whether anything is legal or illegal.
Are you sure, you are not asking this questions as a mischief?