Re the Roald Dahl quote; I know he was an extremely flawed character btw and some of his books are racist and would never be published today.
But re this particular quote, no, I really don't think it is supposed to mean that a person's features change so that they suddenly have a classically beautiful face and smoking bod because they think nice thoughts. Nor is it the other way round, with ugly thoughts changing someone's features to make them lose their classically good looking features.
I always interpreted it as saying that even with perfect features and classic good looks, if you are cruel, vindictive, a bully or generally unkind, people will still run a mile from you, despite your good looks. I definitely think this is true. Even the most beautiful person, if cruel or unkind, will quickly lose their appeal to me and I don't even notice their physical beauty anymore. If you have classically less good looking features, (he says very overweight, crooked nose and chin, hairy wart etc), people will still be attracted to your personality. But no, your face won't literally change into a clasically "pretty" one.
So if boys at school or anyone took this to mean that classically good looking girls deserved their good looks because they thought nice thoughts, I don't think they read it properly.
That said, I think the illustration is more problematic. It does appear to make the ugly thoughts woman look less good looking, so I can see why some people don't like it.
Yes, some people are just better looking, in a widely accepted, standard way. You can look at people and identify the pretty / handsome ones. But my point was, that it doesn't mean these people are the most attractive people and I think the Roald Dahl quote illustrates that fairly well.... but that's clearly open to interpretation.