I want to use the git pull --rebase instead of merge but with this approach one can accidentally rebase commits that were already pushed to another remote.
You can write hook that check to see if any commit within the range of the commits are already in the targeted branch, if so do what ever you want (like rejecting the push)
Using the git commands git branch --contains you can check if the give branch contains any of the given commits.
git does not have anything out of the box for you, you will have to write some custom made code to do it, but you can use the git branch --contains to find out if the branch already has the given commit in it.