Is this okay?

So I had a teacher who got really mad at the whole class she got really angry and upset so i was going to ask if she was okay at the end of the class but I back out because I thought she could take offence. Do you think she would? Is it okay to ask a teacher if they are okay? I’m probably overthinking this a bit.