Bike models and controllers vary widely. Some hub motors have restriction that can be overridden by disconnecting a pair of wires, others by different methods. Some modern e-bikes have digital handlebar displays which have integral methods for coding a required cutoff speed within certain limits. In some cases hub motor bikes can only reach to about the 15 mph limit, and then only a higher voltage battery can increase the speed. The change in voltage gives a pro rata change in top assist speed. Some controllers have shunts which can be soldered, but that only increases power, not speed.
Many crank drive motors are limited by a magnetic wheel speed sensor, which on the odd one or two can be removed to allow higher speed. Most though do not allow such a simple change and then the increase is obtained by a small electronic gadget placed in the sensor circuit. Some but often older crank drive units driving though the chain can have a speed increase merely by changing the rear sprocket(s), but this most suits hub gear models which often allow the greatest amount of change.
Best if you want to take this route is to find one or two bikes you are interested in and then post here asking if they can be derestricted for a higher assist speed.
.