Yes, but what happens has to be a DM decision
There is no doubt that you can store the spell, but there is ambiguity in Glyph of Warding that is not covered by the written rules about what happens when you trigger the glyph, to the DM will have to make a call.
Depending on how the DM rules, the effects will work on the triggering creature, the original caster, or not at all.
I personally think the most interesting and natural (and exploitable) reading it that it would work, and you could transfer Self spells onto other creatures with help of a Glyph of Warding. But other DMs' mileage can vary.
You can store the spell
Technically, you can store a spell with a range of Self into the glyph:
You can store a prepared spell of 3rd level or lower in the glyph by casting it as part of creating the glyph. The spell must target a single creature or an area. (...)
At higher levels (...) If you create a spell glyph, you can store any spell of up to the same level as the slot you use for the glyph of warding.
So the conditions are:
- Spell is of 3rd level (or the level you cast glpyh at) or lower: check
- Spell must target a single creature: the caster is a single creature, check
Both conditions can be fulfilled, so you can store the spell.
Do self Spells target the caster?
Glyph of Warding also says:
If the spell has a target, it targets the creature that triggered the glyph.
So the glyph rewires the target of the spell. Does the spell have a target? Self is a range, and there is not explicit statement in the rules that the caster of a Self spell is also the target. The consensus and inofficial Sage Advice by Jeremy Crawford both conclude that a range of self means the caster is the target1. However, consensus and inoffical statements are not rules text, so ultimately, it is the DM's decision if the spell targets anyone to begin with, or not.
Who is the caster of a spell in Glpyh of Warding?
Another issue is that Glyph of Warding both states that you are casting the stored spell, and that the stored spell is cast when triggered:
You can store a prepared spell of 3rd level or lower in the glyph by casting it as part of creating the glyph. (...) When the glyph is triggered, the stored spell is cast.
So, when is the spell cast? When you cast it into the glyph, or when the glyph is triggered? And who then is the caster? Is it the original caster, or is it the glyph or some unnamed entity when the spell "is cast"? All of this is ambiguous, and needs the DM to decide.
Who is "you" in the spell description?
Normally, for spells with a range of Self the caster and the target (if you rule there is one) are identical. When the spell says "you", it refers both to "you, the caster", and "you, the target". However, if we rewire the target of the spell to be someone else than the caster, then suddenly it is not clear who "you" refers to.
In general, when spells use the word "you", they refer to the caster of the spell, not the target of the spell. Picking a spell to demonstrate this, here is Aid from the first page of spells, p. 211 PHB:
Your spell bolsters your allies with toughness and resolve. Choose up to three creatures within range. Each target’s hit point maximum and current hit points increase
"You" clearly refers to the caster. Is is "your spell", the caster's spell. The targets are different (although they could include the caster, who also is a creature in range). There also is the Etherealness spell, which has a range of Self and states:
At Higher Levels. When you cast this spell using
a spell slot of 8th level or higher, you can target up to
three willing creatures (including you) for each slot level
above 7th.
So clearly, you refers to the caster ("you cast") and can differ from the targets of the spell, even for a spell with range Self ("you target up to three willing creatures (including you)".
If the DM rules Self spells target the caster, it would be up to them to rule if "you" should really read "the target" for these spells, instead of "the caster".
Putting it all together
What does this mean for the effect of the spell? Fire Shield for example says:
Thin and wispy flames wreathe your body for the duration
You is the caster, the spell is cast by the original caster: when the glyph triggers, the original caster's body is weathed in flames, wherever they are at the time.
You is the caster, the spell is cast by the glyph: when the glyph triggers, nothing happens (the glyph is not a creature and has no body to be wreathed in flames).
You is the target (which means there is targeting, and it does not matter who cast the spell): the creature triggering the glyph receives the spells effects.
1 Interestingly, Jeremy also ruled that Self spells can only be cast on the caster.