You can, but it gets unwieldy after a few, and most natives would start to rephrase things.
Just for clarification, for the meaning you described, this first の in this example is a different kind of の. It’s a valid construction, but the grammar works differently.
The literal meaning with the original type of の you were talking about would be “a British person’s high school teacher.”
You have the exact same phenomenon in English with possessives: “My brother’s roommate’s wife’s dad’s car is a Mercedes”. It’s not wrong per se but it becomes unwieldy and hard to parse if you abuse it.
AのBのC is certainly not uncommon though. Here’s a random example:
“Test’s sake’s magic” or more naturally “magic for the sake of (in order to pass) the test”
As @Belthazar points out, I think it’s mostly used when there’s no possible ambiguity. Here it has to be 【試験のため】の魔法 because 試験の【ための魔法】 doesn’t really make sense.
The author proscribes using の more than twice in a row, arguing that it makes the sentence sound clumsy. They then provide strategies to replace の with other constructs like に関する or が持っている.
Though of course when you find style-advice articles saying “don’t write like this” that implies that at least some people do happily write and speak that way sometimes. There’s not usually much need to argue against things that are truly not grammatical
So the punchline is mildly different, but their relationship is the same.
Yah, English grammar is full of people going “you can’t end sentences with a preposition!” and “you can’t split infinitives!”, but neither of those is actually a rule.