I'm quite surprised that with all my riding in NYC, I have yet to experience a flat on a ride.
Twice, I have had slow leaks that I discover a completely flat tire in the morning before my ride.
Replacing a tube on a hub-motor wheel can be more challenging,
but nowadays, more hub-driven ebikes have cable connectors near the hub motor to make that job less complicated.
It's not a complicated retro-fit if you can source the connectors, manage to splice wiring & use heat-shrink.