Let's say a player's wizard character has lost their eye in some event and replaced it with a glass eye. Would they be able to use that glass eye for an Arcane focus while it is in their head?
Maybe. But not likely RAW.
An Arcane Focus is (PHB, 151):
An arcane focus is a special item—an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item— designed to channel the power of arcane spells.
A DM may allow a glass eye if it was originally made to be an Arcane Focus to work (an orb is basically an eye), but I don't think I'd allow any glass eye to be a focus.
And PHB (203)
A spellcaster must have a hand free to access these components, but it can be the same hand that he or she uses to perform somatic components.
The latter quote is an explanation of how to access the component pouch/focus, but I don't think is is prescriptive in that you must use a hand. Just that if you have to use your hand, it must be free to work like that.
Beware the fact that usually the Arcane Focus is something held in the players hand. By removing the need to hold it, you are making it much easier to do things that might have been problematic before. Feats like Warcaster are ways to mitigate holding something in both hands (dual-wielding or shield) and still allow for Somatic components (but it doesn't resolve the Material.) If the player has no need to use a hand for material components (by use of a glass eye), then it bypasses that potential restriction.
In a current game, I've got a Paladin and my DM allowed me to tattoo my holy symbol as well as put it on my armor. This bypassed the need for material components when casting and I don't think it's made a huge impact on gameplay.
In the glass-eye case - make it a bit of a quest to find someone to make the glass eye arcane focus. That gives it some flavor, creates some tension and game around trying to find that person, and still eventually allows them to get what they're looking for.
A glass eye is fine
The rules specifically allow an orb to be a focus and one of the right size could be used as a glass eye. The rules do not limit where you can store your focus so in your eye socket is fine too.
However, you would still need a hand free to access it when you cast a spell that needed it.
All spellcasting focuses require the use of a free hand to manipulate it, unless you have a feature indicating otherwise. See the following rules from the PHB/SRD in the Spellcasting chapter.
A spellcaster must have a hand free to access a spell's material components--or to hold a spellcasting focus...
The best you could achieve without special features is to pull the eye out, use it in your hand as a spellcasting focus, and then reinsert the eye (or I suppose just fondle the eye while it's still in the socket). However, that's only if the DM even allows the eye to count as an arcane focus. Since that's not part of its item description, it would be up to the DM to rule on the availability of that option.
A player that conceives of and takes the time to specifically design and craft (or have crafted) a glass eye for this purpose, should be given some consideration for creatively addressing what is otherwise an obstacle. It can provide significant story and character enhancement as well.
For example, instead of just saying "no" you might introduce a stylized "drawback":
"Over a period of several weeks, you finally manage to create a unique and powerful artifact. This glass eye can be used as an Arcane Focus without being held in the hand -- as long as it remains in place in your eye socket for 24 hours beforehand so as to remain attuned to your essence.
"However, it also constantly glows with an otherworldy energy that makes you extremely noticeable, day or night!"
I think a specially designed glass eye would work.
If there were an issue with trying to have a weapon or something in both hands it could be resolved with the statement of the somatic components still needing your entire hand to function and for non somatic spells poking or placing your hand over the glass eye for a moment could be a solution.
if you google Arcane Focus this comes up."An arcane focus is a special item–an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item–designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus" so if its a Crystal eye and your playing 5th edition then i would say yes. you can use a fake eye if its a Crystal eye.