As Phil says, there is never usually any ambiguity in the spoken language, because the stress pattern is different.
An 'English teacher', in the sense of person who teaches English, is a compound noun composed of two nouns, like a 'geography teacher' or a 'science teacher'. The rule with compound nouns is that you stress the first element. So the main stress of the noun phrase 'an English teacher' would be on the 'Eng' of 'English'.
By contrast, 'English teacher', in the sense of a teacher who comes from England, is composed of an adjective and a noun. In normal speech, we would place the stress on the noun, so if we are describing the teacher in term of his/her nationality, the main stress on the noun phrase 'an English teacher' would be on the 'teach' of 'teacher'.
If this seems confusing, think of the example of 'a green house' and 'a greenhouse'. In the first, we stress the word 'house'; in the second, we stress 'green'. This works even if the compound noun is made up of two separate words. For example, with the fixed term 'a black cab', referring to a typical London taxi, the stress falls on the word 'black', indicating that this is a compound noun. This is different from 'a black car', for example, which would have the stress on the noun 'car'.
Using and interpreting stress patterns is something that comes instinctively to native English speakers. If an Australian, for example, said 'I'm an English teacher', this would never cause any confusion for fellow native speakers, because the stress on the word 'English' would make it obvious that 'English' was the subject taught rather than the speaker's nationality.
In written English, the context would probably make it clear what is meant.