No.
You can allow iCloud to manage your local photos storage.
iCloud Photos does host your photos on Apple’s servers, and you can let iCloud manage how your photos are cached on your iPhone…
But… if you delete a photo locally (when iCloud Photos is enabled), it will be deleted everywhere.
See the optimize-storage info here: Manage your photo and video storage - Apple Support
There really isn’t a great way to work around a lack of local storage on an under-configured iPhone or iPad. Some offloading is possible (and iCloud and iCloud Photos can help there), but can require ongoing storage management.