Gitlab CI doesn’t mandate anything - you can run it on a “bare metal” server. However if you use a kubernetes executor it mandates that your builds run inside a container image, which is fantastic for reproducibility and visibility. Everything is versioned and can be customised at the repository or branch level with very little effort.
Of course this limits some more esoteric builds that might need dedicated hardware or for whatever reason cannot run inside a container, but you can mix executor types if you so please.