Depending how handy you are, there's a few answers. Although other answers/comments touch on some of these, I'd like to recap to add my own comments to those, too.
I would also like to see pics of (1) the hood itself, perhaps slightly angled from above or below to get a sense of the 3D form, and (2) the entire cupboard space, like maybe a wide view, 600mm either side of the hood, to get a sense of context, and how rigid or truly fixed the cupboards are likely to be. It would help to add those to the question.
Shaving the edge of the hood
As @isherwood says, stressing tempered glass (which this will be) is a dead end. It can't take it. But equally no need to take it to a glazier either (although definitely safest).
If you truly are missing just 1 - 2 mm of width, I'd buy a diamond faced wheel, and grind one or both edges myself. Low pressure from the tool, and use plenty of slightly diluted washing up liquid (USA: dish soap I think) or other cheap lubricant, in this case, rather than the more usual running water or light oil. (Squirt and smooth onto the surface before grinding). You can get cheap disposable dremel-style diamond faced 60-75mm wheels like this, online, larger will work better as a rule, easier to position and check its smooth.
You only need to shave a little off, and only up to about 30-35cm from the wall where it runs along the cupboard. So from the front it will look untouched and retain its polish. Drag the wheel at a slight angle, so you're grinding not cutting, and so you don't dig in.

After you have the width right, run/grind the wheel again, this time at 30-45 degrees from both above and below, to ensure the newly shaped edges don't have sharp spurs at the top and bottom, as these might not fit (if the grind wasn't level), or could cut into the wood, or worst case may jam it.
A lightweight wheel like this has virtually no chance at all of cracking or stressing it, and can be used in any household drill.
Flexing the wall of the cupboards
I'd be wary of flexing with a temporary wedge, as one suggestion said. Same reason as above - when you remove the wedge, there will be extra pressure on the glass - and the glass is angled which reduces its ability to handle pressure side to side (in effect its already got a "fold" in it, as well as low tolerance of stress).
If you are going to flex the sides, perhaps use some kind of material with nice rounded ends that can be left in place, if possible, against the wall.
But even then I have my doubts. The board that makes up the back of the cupboards internally/behind may be a problem, though hopefully not. Depends on the material (thin hardboard or actual wood sheet, and whether if it slots in a groove or is nailed/glued (which makes the 4 sides a bit more rigid). They can be either.
That said, the cupboard sides may flex anyway but then I have a more serious concern - you dont want wood permamounted above a cooker, but at the same time any other material is hard to get to the exact width needed, and will prevent the hood lying flush to the wall. And also, more serious again, if you brace the back edges apart, the front edges (30 or so cm from the wall won't be braced apart and may retain their original spacing.
Overall don't like this idea.
Move the cupboards
A millimeter isn't much, and they aren't plastered in place (from the photo).
Don't use a rubber mallet. Instead, if they have room to move at all, remove all internal shelves and put a 4x2 inch (100x50mm) piece of wood up against the side of the cupboard to spread the shock and prevent damage, and use a club hammer more towards the top where mounting is expected to be.
The pic gives the general idea, using a light piece of wood and lightweight hammer though. You want heavy hammer/mallet, so it can be hit relatively slowly and still transmit momentum/impulse/shock to the cupboard mount.
Also - important! - the wood should be the full length, overlapping top and bottom corners, not just in the middle as I've shown, so it moves the cupboard as a whole not just bends the side a bit.

Of course don't do this if the finish might be cracked by it. You'll have to judge that. It * shouldn't * ...... if its in decent condition.....
Replace the hood
Easy solution if grinding and nudging across aren't options. As you say, metal distorts a bit easier and certainly with less risk.