It is absolute legal if your H4 application is filed
before F1 is expired. However you can not leave country before H4 is approved. And you need keep your H4 receipt as a record
before F1 is expired. However you can not leave country before H4 is approved. And you need keep your H4 receipt as a record