I missed this. Though Pratchett invented it.
Nope, though to be fair it's apparently buried in a bunch of the extra-canonical material published after he died. The only reference in LotR is something in the appendices, about how outsiders think female dwarves must have beards, and that female dwarves are very rare.
I do love the way Pratchett has elaborated on it, and even gone so far as to apply the male-default within dwarf culture itself, rather than as something appearing only to outsiders.
... erm, that was kind of hard to follow. What I mean is: in Tolkein, outsiders can't tell the difference between male & female dwarves, but presumably dwarves can. In Pratchett, nobody but the dwarf himself can tell the difference, which is why it's so scandalous when the Ankh-Morpork dwarves start wearing female clothing. (I wonder what this says about traditional dwarf marriages--some are same-sex, I guess?)
(And I think we can assume that at least some of the female-dressing Ankh-Morpork dwarves don't have male genitalia, because who would know? There's some excellent fanfiction to that effect on the AO3.)