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.
See /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
pullup.
Load: dtoverlay=w1-gpio,<param>=<val>
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
dtoverlay=w1-gpio,gpiopin=12
GCLK
signal. For the same reason you can only useGPIO11
as SPI clock.