Can a cassette be fitted to a freewheel
Do you understand the difference between a cassette and freewheel? It's very confusing because people don't use the correct terminology. The difference is the hub. There is a free-wheel hub with the threaded boss and the free-hub, which is a spline. The gears have to match the hub.
In the old days, all rear gear clusters were called cassettes, but now those in the know call free-hub gears cassettes and free-wheel gears freewheels.
When you fit a motor or any new wheel, you have the option to switch from one gear type to the other, but there are some limitations. Generally, free-wheel gears go up to 7 speeds and cassettes go higher. Your shifting system determines how many speeds you have, but even that can be changed fairly cheaply.