Yes, but you can't change targets
Hex can target a single creature.
You place a curse on a creature that you can see within range.
Indeed, the text of hex repeatedly refers to this one creature as 'the target'. This satisfies the requirement of the spell glyph option of glyph of warding.
The spell must target a single creature or an area.
Therefore, you can put hex in a glyph of warding. The hex will be cast on the creature triggering the glyph. Since you are still considered the caster, you (the caster) will deal extra damage to the target per the normal functioning of hex.
However, there is a caveat. Hex can, over its duration, target more than one creature (while still only affecting a single target at a time). A similar question asking 'Can Hex be Twinned?' covers this. Twinned Spell requires that the spell is incapable of targeting more than one creature, and the general consensus leans towards hex not being eligible for being twinned (although there's some wriggle room).
However, glyph of warding is not quite as strong in its wording as Twinned Spell. It says that the spell must target a single creature. This can be read as a constraint on how the spell is to be used in this particular casting, rather than as a constraint on the general properties of the spell. Taking such a reading, this requirement is satisfied if you do not change the target of this hex once they drop to 0 HP. If you consider spells which target 'up to' X creatures, such a spell can target only one creature, so when used in conjunction with glyph of warding it must be cast in such a way to only target one creature. I argue that hex would be a similar case, although uniquely the constraint applies after the spell has been cast rather than during the casting.
If imposing such a constraint on hex seems unreasonable to you, then my argument breaks down and hex would become ineligible for glyph of warding.
One might get caught up on how the spell glyph specifies that "you can store a prepared spell". One could attempt to argue that this means that only spells from classes who prepare their spells (such as wizards and clerics) are valid and spells from spontaneous casters such as warlocks cannot be used (because they know spells rather than prepare them).
However, such reasoning results in a fallacy, for glyph of warding is also on the bard spell list, and bards are spontaneous casters. This spell would be substantially less useful for them if they could not use half the features. It thus seems absurd to make a distinction between 'known' and 'prepared' spells for glyph of warding. Likely, use of the term 'prepared' is just to clarify that you need to be able to cast that spell today (as opposed to using any spell from your spellbook or the cleric spell list).
See 'Can a Bard use the Spell Glyph option of the Glyph of Warding spell and cast a known spell into the glyph?'