Whenever you want to merge something into master, the best approach is to create a branch where you create the end state you want on master, and merge/PR that branch.
So when a developer wants to merge something from their project branch to master, they would create a new branch, merge master into it (if necessary), fix any and all conflicts and bring it to the state that makes sense with respect to master, which includes fixing the .gitmodules configuration in your case. They would then submit a PR to merge that branch into master. There should be no conflict now, since the conflicts were resolved before doing the PR.
This advice holds for any and all PRs: it's good practice to make the person submitting a PR resolve the conflicts on the PR branch, rather than have the owner of the master branch do it. And even when the owner resolves the conflicts for the submitter, they can do it on the PR branch before accepting the PR. (I might do that for one-time contributors if I don't think it's worth teaching them how to resolve their conflicts, but I consider it a good learning opportunity so I generally prefer to spend the time showing the contributor how to do it instead.)
.gitmodules) in Git are not in branches, but rather in commits. Branch names move; commits never change once made. We use branch names to find commits, and move branch names around so that we find different commits. The file contents within any one given commit are constant.