Yes to both, ( unless your bike has a perculiar BB and crank) BUT......
fwiw i upgraded my 7speed rear cassette to 8 speed when converting my bike, not a lot of hassle at the wheel end but the replacement 8 speed gear changer is a LOT stiffer than the original 7 speed, and i dont use the extra gear at all, 99% of the time im in the top gear (smallest rear cog) switching to a mid gear only for faster/easier to start pull aways from junctions/lights, when riding both with and without assistance.
With hindsight upgrading your 7 speed cassette with one with a smaller tooth count high gear to aid in 15 mph pedalling if your currently using a gear with 13-14+ teeth may be a better option,,
Also be mindful that when using the motor assist uphill if the gear/pedalling pace + motor cant maintain 8mph+ the mtor will be under undue duress and be at risk of overheating. So the best gear teeth count range on the cassette tosuit you will depend on how and where you intend to ride the bike