Potentiometer signal as a speed reference for a drive
You can use a potentiometer for a speed setpoint. The details depend on the drive setpoint input options. If the drive takes, say, 0-10V and has a 10V output you can connect a pot directly (and the drive manual will show you how exactly to do it, and suggest the range of possible pot element resistances). 

If it accepts only 4-20mA you would be best to use an appropriate transmitter, and refer to the transmitter manual for the appropriate pot resistances. 

A pot is best for rough settings and fast easy changes, maybe for something like a conveyor. If you need precise settings that are rarely changed, digital input (like from the drive keypad) might be better. 

As to the distance, voltage signals are best over relatively short distances, preferably within a cabinet or machine. Say up to a few meters. In ideal conditions you can extend it much, much further, with a shielded cable, but in a typical high EMI environment it's best not to. Current signals can be sent much further- hundreds of meters- with little trouble, however you may still have to take precautions if lightning and similar issues can occur nearby.