(d) The former (what) is an adverb that means something like "how much";
the latter (what) is the object of care.
in that the use of the former what is an adverb,
that means in what respect does he care
or as you say how much does he care about what other people think.
It would make sense and, by substituting, would be grammatically correct
i.e. How much do you care what other people think? "