There's no mention of dandruff at all in the joke.
All it said was he was a hunk and the chicks were smitten. I would think if he's got dandruff bad enough that she's saying he should use Head and Shoulders, they wouldn't be so smitten.
It doesn't make sense, it's fucking british comedy. Stupidest shit ever.