Just make sure 'Optimize iPhone Storage' is checked in settings... as your space gets low iOS will automatically resize or
delete local copies of photos from your phone, but they will still be in iCloud. (if you go to view one of those photos... it will quickly download it).
but to answer your question.. yes, if you turn off sync on your phone you can delete local and it won't effect icloud.