@am9799 no International can not take online classes without prior approval of the US government.Plus you must enter the US to get your I-20 and visa cleared. As my son is an international student I know that spring they got a special approval. Summer is not counted but from his university they’ve recommended that he does not leave the US.
This is an article from Boston University