Can the amount of sugar (in grams) of a food determine a food's glucose level?

Absolutely . Carbs are the predominant food component that influences glucose levels in the blood. Of course during food abstinence/starvation you have the liver as the main source of glucose, but during eating, it's the amount of carbs (excluding fiber) that dictates how high your blood sugar will be.