Can students call their teacher madam?
Example: In a conversation between a teacher and a student.
Student: May I open the window, madam?
Teacher: It doesn't matter.
Do people in UK or USA use this term?
It depends on the region and local registers. In India, it's pretty a common term that students use for their teachers. Also, note that some practice 'Madam,' others use 'ma'am.' Nevertheless, I now observe that 'Miss' is also getting grounds in India these days. It's worth to note that even though a lady teacher is married, she's addressed as 'miss' by her students.