I would say generally yes if it is controlled by the teacher properly. If the teacher thinks he/she can control it and it is appropriate for the particular class then it should be allowed. If the teacher doesn't think it could be controlled enough and it is inappropriate for the class then it shouldn't be allowed. Ambient music in classrooms during study hall times could even enhance productivity if appropriate genres are used (such as classical or relaxing ambient). I think it should ultimately be up to the teacher but I see no reason why it shouldn't be allowed in school.