The DS18B20 is a (Dallas) 1-wire bus temperature sensor. It uses one wire for control and data.
Early versions of Pi software only allowed for the 1-wire bus to be started on GPIO4. You are looking at old or incomplete tutorials.
Recent versions of Pi software allow the 1-wire bus to started on any spare GPIO. There is still the limit of just one bus though.
To configure the 1-wire bus use device tree.
/boot/overlays/README for details.
Name: w1-gpio Info: Configures the w1-gpio Onewire interface module.
Use this overlay if you *don't* need a GPIO to drive an external
Params: gpiopin GPIO for I/O (default "4")
pullup Non-zero, "on", or "y" to enable the parasitic
power (2-wire, power-on-data) feature
E.g. to use GPIO12 (pin 32) use
GCLKsignal. For the same reason you can only use
GPIO11as SPI clock.