G-code has many subtly different dialects. The core functionality is pretty much the same for any class of machine and number of axes, but as each manufacturer has proprietary extensions and settings, so unless you are writing hand-crufted G-code, whatever software you are using to generate the G-code for the toolpath needs to know to output GRBL 'flavor' G-code, and as GRBL is so ubiquitous, is probably going to need to know a whole bunch of machine parameters as well.