Provided your vendor is installed from source, you can modify and push it. To force installing from source, use the --prefer-source
option:
composer install/update --prefer-source
Then cd
to your vendor's directory and you'll see it's a separate git repo. You can do a pull in there to get the latest version, make a change and push it back.
The same works for 3rd party bundles. In that case you just need to add a git remote to your fork to push to it.