I’m not an expert in technology, but I’m pretty sure it doesn’t delete eSims since they are actually stored in a separate chip. I’ve done some experients with wiping data (I’m always curious about new tech so I always do some testing to satisfy my curiosity) via remote wipe, both Android and iOS, I’ve intentionally entered incorrect password to get it to reset, and I’ve used the recovery menu in android to reset it, and I’ve used android apps that lets you wipe data via the device admin feature. The eSim always persisted unless you specifically choose to delete it, so I think flashing a rom isn’t gonna be different as long as your don’t send a command to the eSim chip to wipe the eSim data.
Which can be a bit worrying if a theif is able to reset your phone and bypass the anti-theft device activation features (which is difficult, but not impossible), they could use your eSim if it doesn’t have a Sim pin to protect it, which nobody even thinks about locking the eSim since most people would assume it is safe behind the phone’s lockscreen and it would get deleted in a device reset, but the eSims never get reset unless you specifically chose to.
1 small security fix and 10 more spying software