Same as Photoshop, GIMP has never intended to handle RAW files. If you want to edit a RAW file in GIMP you need to convert it first into format that is recognized by GIMP. In the context of photography, the format usually is JPG or TIFF. There are several tools you can use to open RAW files and convert them into either JPG or TIFF. One of which is RawTherapee.
You can combine RawTherapee and GIMP on your photography workflow, especially if you are just a photography hobbyist who don’t make money with your photos since both RawTherapee and GIMP are free. They both are cross-platform apps that are available for Linux, macOS and Windows.
A brief story about RawTherapee. It’s an open source RAW processor, released under the GNU General Public License. It recognizes a lot of RAW file extensions, including two most popular ones: CR2 (Canon) and NEF (Nikon). You can actually use RawTherapee to make some adjustments like setting the exposure, white balance, saturation and so on, but for a more advanced settings and edits you still need a more capable tools like GIMP.
RawTherapee allows you to edit the current image (image you are opening) with an external image editor and it uses GIMP as the default image editor.
Assuming that you have installed both RawTherappe and GIMP on your computer, launch RawTherapee on your computer and select a RAW file you want to open with GIMP. You can use the folder selector on the left panel to select the image you want to open. Double-click on the folder to bring the contained images to the center area of RawTherapee.
Once you have selected the folder where the RAW file you want to edit is located, double-click the RAW file you want to open. Once the file is open (in RawTherapee), click the palette icon below the image to open it with external image editor (GIMP in this case).
Wait a moment. RawTherapee will convert the RAW file in a GIMP-recognized format and launches GIMP for you.