The way it works is that the regulator will try to adjust the current through its pass transistor so there is a constant voltage (about 1.2 V for the LM317, 5 V for the LM7805) between its output and adjust/ground pin. So if there is a 1 ohm resistor between output and adjust, the LM317 will try to force 1.2 A through it so there is 1.2 V across this resistor. This current will flow through the load, which is connected in series with the adjust pin and resistor. There is also a tiny amount of current flowing from the adjust pin to ground, this current is typically specified in the datasheet, and creates an error, especially at small currents.
So as first approximation you can calculate Rset = Vset / I, or Rset = Vset / (I - Iadj) if you want to take the current through the adjust pin into account. Vset would be about 1.2 V for an LM317, Iadj in the uA. For high currents, you might need a power resistor (for 1 A, 1.2 W would be dissipated in the resistor with an LM317, 5 A with an LM7805). You also need to take the dissipation into account. In worst case (output shorted to ground), the regulator will have to dissipate (Vin - Vset)*I, or 29 W for 1 A from a 30 V power supply.