This is one of those topics where, on a relatively surface level, it is rather simple: canon--in D&D--is whatever the DM says it is, and communicates to the players. "We're playing in the Forgotten Realms, but these aren't your father's Realms." Or, "It is a homebrew world, pretty standard D&D with a few twists. It is D&D land, but don't assume anything and expect the unexpected." Or, "We're playing by-the-box Greyhawk; anything published after 1983 doesn't exist."
Pretty simple and straightforward; it gives the players a sense of what to expect, as well as to what degree their expectations may or may not hold water. Meaning, it really only takes a single sentence for a DM to establish canon. They don't need to go through every little detail; they just need buy-in from the players.
The nature of D&D is one of endless customization. Each game can do things differently, whether by-the-book or a complete remake of the game with a ton of house rules and a homebrew of very non-traditional fantasy. I mean, isn't that one of the qualities of D&D that makes it so great?
Media properties are a bit trickier, and really have to be approached on a case-by-case basis. Star Trek is tv and film-based, which makes it visual, so there's all sorts of issues that arise like, why are Klingons so different in the OS vs. Discovery? (We all know it is aesthetic, but how do the showrunners justify it?).
Furthermore, Star Trek has had different iterations stretching over more than half a century, with only the original series, some of the films and a few seasons of TNG being directly supervised by the creator, Gene Roddenberry. After Roddenberry's death, "canon" was whatever Paramount says it is, at least from a legal licensing sense.
Lord of the Rings is a bit different, because unlike Star Trek--or even Star Wars--it is closely tied to one person, John Ronald Reuel Tolkien. Middle-earth is Tolkien, or rather Tolkien's imagination. There's a reason that we haven't seen a line of novels set in Middle-earth, presumably because his son Christopher Tolkien (RIP) carefully protected his father's legacy. We're about to experience a massive upwelling of distressed Tolkien fans once the Amazon series comes out, at least based upon what I've heard.
The whole concept of "gatekeeping" baffles me because it has never been an issue for me, and I've never witnessed it first-hand. I know it happens at cons, but it mainly seems to be an internet thing and seems to arise from people giving too much power to words and opinions. I mean, I personally think that the new Star Wars films feel like fan-fic, and don't really feel like "real Star Wars," but that shouldn't affect the experience of someone who loves the new films, or was introduced to them by JJ Abrams and thus feels like Rey and Kylo Ren are "the" iconic Star Wars characters. And it shouldn't matter how vociferously I express my opinion. I mean, if my opinion ruins your enjoyment, you can tune me out. Unless, of course, I'm coming to your house and plopping myself down on your couch and screaming at your The Last Jedi blu-ray.
I don't think it is gatekeeping when a serious Tolkien fan says, "Glorfindel doesn't have lavender skin." Sure, you can run a One Ring campaign and say elves have lavender skin, but that isn't Tolkien's Middle-earth, and due to the nature of the property, it understandably doesn't feel true to the "real" Middle-earth.
Truth be told, Tolkien didn't always go into details, leaving a lot to imagination (unless you deep-dive into the History of Middle-earth volumes, or the recent The Nature of Middle-earth).There's even debate about whether Balrogs have wings or elves have pointy ears. Tolkien deliberately left a lot up to the imagination, so that readers could flesh out the details with their own imaginations, make their own versions. Now of course John Howe and Ted Nasmith and Alan Lee created vivid imagery, which in turn inspired Peter Jackson, and so for many Middle-earth is not Tolkien's version, or even as Tolkien intended--a hybrid of his and your version--but the version that Jackson concocted.
But if you're running a game set in Middle-earth, there is no canon - just what the DM envisions. If a Tolkienista player has a problem with that, that's a matter to be resolved between two people, not an issue of canon. Meaning, no external authority figure can solve it for you. It has to do with table agreements--that is, social contracts. I've always taken the approach that the DM, as the person that takes on the joy and burden of doing more work than the rest of the group combined, gets the privilege of choosing the setting and parameters for the games. Most DMs are reasonable and will consider player input and take into account any serious complaints; similarly, most players are conscientious and won't complain unless it is serious.
So I have to ask: is gatekeeping really a thing? Or rather, is it as much of a thing as some make it out to be? I mean, I imagine it is in some cases; I'm not saying it doesn't happen. But how much of it is misperceived and over-exaggerated? How much of it is just opinionated people on the internet, and others misconstruing said opinions as a threat? And, while I'm at it, to what degree are we all just frogs in a pot of heating water, looking for another frog to blame for the rising temperature?!