I'm having online class is it correct English?

The sentence "I'm having online class" is grammatically correct, but it would sound more natural to say "I am taking an online class" or "I have an online class."

Yes, the sentence "I'm having online class" is grammatically correct in English. However, it is more common to say "I have an online class" or "I am taking an online class."