No.
If multiple devices synchronize their Photos databases with iCloud, by doing so, they indirectly synchronize their Photos libraries with each other. Add a photo and you will be adding it everywhere. Delete a photo, and you will delete it everywhere.
iCloud always keeps full-size copies of your photos and videos. You can tell a device to "optimize" storage – in which case you are giving it permission to keep reduced-quality, space-saving copies. But that device will still attempt to keep copies – even if only space-saving ones – of every photo.
----------
That said …
On a Mac, it is possible to have multiple Photos libraries. In that case, you could have a "system" Photos library, connected to iCloud Photos, and one or more local Photos libraries. The "system" Photos library would operate according to the synchronization rules outlined above, but you could have photos in the secondary, local Photos libraries that would appear only on your Mac – not on your iPhone.
Create additional photo libraries in Photos on Mac - Apple Support
Unfortunately, you can only work with one Photos library at a time. If you would like to move some photos out of your "system" Photos library, and into an additional library (so they are still on your Mac but no longer appear on your iPhone), you can't open windows onto both libraries and drag-and-drop, to copy photos complete with both original and edited versions (and the ability to Revert to originals).
You have to do something like
- Running Photos on the "system" library
- Exporting the photos you want to move, then deleting (but not permanently deleting) them
- Quitting Photos
- Running Photos on the local library
- Importing the photos you just exported
This is clunky and Apple really should do better.