Git itself is simple, but is their .md file renderer open? Are their workflow runners available anywhere to re-use? The API also has gaps (esp if you wanted to migrate your PRs or Issues over), though I don't remember what was the thing I couldn't achieve with it.
But I guess you are referring to indirect, incidental domination like "social" lock-in (I always smile at job application forms asking for a GitHub link — I've got thousands of free software commits in their own, dedicated software forges, but very few things on GitHub directly, or at least, in mirrors not tied to my GH account), "marketing" lock-in (I've heard many junior and not-so-junior engineers refer to GitHub as "Git"), etc...
This part seems mostly interoperable. GitHub's alternatives seem to have implemented something mostly compatible. If you migrate from github to gitlab or gogs or gitea or forgejo, that part will probably just work.
Worst case, markdown is still mostly readable as is and a commit can fix the odd non working thing.
But 100% agree with the rest of your comment.
GitHub has managed to create a network effect by trying to be a social network and succeeding. They managed to create fomo for code hosting. This very HN post shows this.
Forgejo is a fork of Gitea which is a clone of Github.