Question: Is it allowed for a student to leave one class to another class, which is not his class, in order to attend a sitting that is better than his class?
Answer: “That is not allowed for him. This is because those who are in charge organize these classes and bring the teacher to teach in this place where the students are assigned for the lesson. The teacher is obligated to be present and it is upon them to attend. It is not allowed for them to go to another place because this [attending the class] is desired from them. This is something which is based on the school system, so a person does not have a choice in it. If everyone did this, the teacher would not have any students”.
[Sharh Sunan Abi Dawood no. 375]
Faisal Ibn Abdul Qaadir Ibn Hassan