If you have iCloud Photos turned on in both devices, any photo you delete from one will be deleted from iCloud and from the other device(s).
However, if you want to completely erase the iPhone 8, you can use the following procedure and it will not affect anything on the new iPhone: Sell, give away, or trade in your iPhone - Apple Support
If you don't want to do that, another option would be to turn off iCloud Photos on the iPhone 8 before deleting photos there. See: How to turn off iCloud Photos - Apple Support