I am doing such merges constantly :)
I have a checkout of nixpkgs, and sometimes have a few unrelated PRs open. I want my system to use a version of nixpkgs that includes all my changes. Thus, I have a script that finds all the branches with my PRs and makes a merge of upstream/master with all of them.
I never push that merge commit anywhere and never commit anything on top of it; it's just there so that I can point my nixos flake at a version of nixpkgs.