Although the book Boy was based on real events, several of the characters have been renamed, such as the villainous Mrs. Pratchett being named Katy Morgan in reality. Thus, given that the Headmaster of Llandaff Cathedral School was never named, it is possible that this could also be seen as a fictionalization of real events.
That is not to say that the Headmaster and the other masters did not torture or cane small children; we all know they liked torture. But because Dahl (perhaps purposefully) talks of the Headmaster as being nameless, we are going to address him as fictional for the purposes of this article.
The Headmaster is an unseen, fearmongering giant who lurks in the depths of the school (which is a primary, but is as large as a college in Dahl's young eyes) and the Headmaster is described as a gigantic looking man, who had slicked, oiled hair, and who wore a tweed suit, and a black gown over it. This impression gave Dahl the idea to call the Headmaster "the angel of Death."
The Headmaster takes delight in Roald Dahl being humiliated; when him and his friends decide to drop the dead mouse in the box of gobstoppers to humiliate Mrs. Pratchett; the foul woman shuts down the shop, goes to the Headmaster, and says he has hooligans on the loose, and to search them out. She gets the Headmaster to walk down the courtyard with him, as he has ordered the boys to go out and line up outside and no talking. The Headmaster then walks Mrs. Pratchett down the rows. Dahl is relieved he didn't kill her (because Thwaites, his friend, had unhelpfully told him that an old woman would have a fatal heart attack if a dead mouse was found in her sweet jar). But soon Dahl's relief turned to fear when the Headmaster singled out Dahl, Thwaites, and the three other boys. Summoning them to his office the moment they got inside, the Headmaster said he didn't want any lies, and outright caned the boys. He made them stand up in a line to watch the first boys being caned. The Headmaster was a very sadistic man, and he made the boys take down their trousers before being caned, possibly getting a bit of perverse sexual pleasure from this caning too.
When Roald Dahl got to be caned, he said the Headmaster was acting like he was a professional by this time because he had caned all the other boys before. Dahl also said it was alright for the Headmaster, because he didn't have to sit through agony. Later, Dahl's mother was shocked at the bruises and went to the Headmaster to say she'd pull her son out of school. The sadistic Headmaster just said she was a stupid foreigner and she didn't understand how English schools went.