In British English, the term "headteacher" typically refers to the principal or the leader of a school, not specifically a class teacher. However, the term can also refer to a teacher in charge of a particular class or form within a school.
For class-specific teachers in British English, you might refer to them simply as "class teacher" or "form tutor" (the latter often used in secondary schools).
In American English, the term "homeroom teacher" is commonly used for the teacher assigned to a specific classroom or group of students, particularly in middle schools and high schools. This teacher usually takes attendance and manages the class during the homeroom period.
So, to summarize:
British English:
Headteacher (principal of the school)
Class teacher or form tutor (specific class teacher)
American English:
Homeroom teacher (specific class teacher)
The term "headteacher" is correct, but it refers to the principal rather than a specific class teacher