少し不自然かもしれません。
focus on ~→ 「〜に意識を向ける」
例)I focused on the teacher’s explanation.
(先生の説明に集中した)
stay focused→「集中した状態を保つ」
focus on an online classが不自然な理由は
focus on の後ろには、
・the lesson
・the teacher
・the lecture
・studyingなど「注意を向ける対象」が来やすいから
→「オンライン授業そのものに注目する」
みたいな意味になっているため
it is difficult to stay focused in an online class
(オンライン授業では集中した状態を保つのが難しい)
になります。
to stay focused/ in a face-to-face class「対面授業では、対面授業中に/ 集中した状態でいる」
to stay focused/ in an online class「遠隔授業では、オンライン授業中に/ 集中した状態でいる」
「授業中に、授業では」という意味の、in class が正しい