Anyone on H1B who is working in US or is arriving into US for work will have to pay. F1 on OPT is F1 Visa and not on H1B. If they choose to get a H1B at the same time, if they use it to work then they have to pay.
https://www.wsmimmigration.com/immigration-resources/faqs/fi...
F1 is the same. You can have an expired visa but maintain legal student status in the US because visa is for entry only.