That letter can have multiple sounds.
Firstly, there is no distinct "g" letter on arabic. The sound itself would be interpereted as either ج or ك depending on where the speaker/listener is. That said, in some places, such as Egypt for example, pronouncing ج as "g" is actually common.
For words that are borrowed and come from other cultures, sounds may be brought over for pronunciation more similar to the word's origin. Not exact matches of course but it means sounds like "g" will pop up in borrowed words sometimes.