The photos you are seeing in "From My Mac" are photos synced from a computer, not necessarily a Mac. You cannot delete them directly on the iPhone or iPad. To delete these items sync the device again with a computer, but do not select Photos albums to sync. This will remove the previously synced items.
If you do not have access to a computer, you can use a brute force approach and enable temporarily iCloud Photos in the Settings > Your Name > iCloud > Photos. Do not enable "Optimise iPhone Storage", as you will probably want your photos to stay on the iPhone and not to be removed to iCloud only. This will automatically delete all synced photos, because the manual syncing is not compatible with iCloud. Once the synced albums are gone, disable iCloud Photos again.