If your battery runs out of charge, you will lose the power assistance from the motor. However, you can ride an E-bike without the battery like a traditional bike. Some of the electric bikes like Moov8-X comes with Shimano gears that makes riding easy without electric assistance. E-bikes equipped with small swappable batteries allow you to keep an extra battery in your backpack for long-range riding or off-grid living.
Riding an e-bike without the battery will not harm or damage the motor. However, riding with a flat or no battery will make the e-bike harder to pedal.