If you have a disc brake in the back, it is no problem at all to switch between rim sizes. The effects (good or bad) of switching to a smaller rear rim and smaller diameter rear tire include the following:
Lower bottom bracket height
Slightly lower center of mass
Slightly slacker frame angles
Change in steering trail (depends on specific before & after angles and wheel diameters)
Stronger wheel, all else equal
Higher rolling resistance, all else equal
Degradation in ride quality, all else equal
Lower unsprung weight, all else equal
Reduction in gyroscopic force
Reduction in moment of inertia (less energy to spin up)
Increase in thrust for any given motor torque
Reduction in road speed at motor free speed
But one of the reasons that does not fall under "all else equal" is the fact that you can usually fit a fatter rim and tire if you drop to a smaller rim diameter, without fouling the frame. In some cases, you can substitute a rim a couple of inches smaller, but have the inflated diameter of the fatter tire be about equal to what it was before. This characteristic has been used in the hot-rod styled cruiser bike sector, where some manufacturers have substituted 24x3.0" tires for the 26x 2.125" tires that were standard on cruisers.
In the e-bike world, smaller rims are put on hub motors most often for the purpose of reducing the overall diameter of the wheel, to help the motor attain a more efficient RPM for high performance.
Chalo