You can indeed "merge" a branch B into branch A without having to check out branch A, but only if it's a fast-forward merge.
You can use a refspec with fetch to do the "merge". If merging branch B into branch A using git merge would result in a fast-forward merge, then you can do the following without having to checkout A:
git fetch B:A
The Documentation
The above matches the refspec format
git fetch :
From the documentation for git fetch (emphasis mine):
The remote ref that matches is fetched, and if is not empty string, the local ref that matches it is fast-forwarded using.
See Also
Git checkout and merge without touching working tree
Merge, update, and pull Git branches without using checkouts