Can a basic single speed shop fan (no light) be converted to 3 speed via different type toggle switch?
I bring up variacs as my first reason to meet current code if your AHJ doesn’t have the exceptions my state now has for devices known to cause tripping.
If the fan is a single speed or has only 1 winding, there are only 2 ways I know of to make it variable speed. The first is a variac - this is a variable ac transformer, kind of expensive and larger than most single gang boxes used in homes. The good part is since fans are low current devices there are models that can do the job and fit in a double gang box ( but be prepared for sticker shock). The second and more common method is an electronic speed controller, much like a light dimmer but rated for motors. These will usually fit in a single gang box and cost less than variacs.
Now the part that most don’t know. Electronic controllers create harmonics on the electrical system and may cause nuisance tripping of both AFCI & GFCI breakers, I have not had a variac cause a trip and years ago only used them 2x when a contract required less harmonic noise than could be done with electronic controls. Luckily, my state allowed circuits that had troubles with GFCIs and AFCIs to be omitted if dedicated. I have installed several more variacs for a homeowner that wanted cleaner house hold power with cost not being an issue. I had to add stops for the low speed side of the variac so the fan would spin plus a little buffer, but it works quite well on the fans I installed with a variac rated at 5 amps when the fans were 3-4 amps max, but they are larger and require a double gang box. The pump actually required a much larger box but this is about fans so speed can be varied by electronic means (solid state) or with a variac, a variable AC transformer.