Place 1 egg into a saucepan cover with water by 1 inch. Cover the saucepan and bring the water to a boil. Once the water is boiling, immediately remove from the heat and let the egg stand in the hot water for 15 minutes. Pour out the hot water and cool the egg under cold running water in the sink; peel and chop the egg. Meanwhile, bring a saucepan of water to a boil. Stir in the corn and return to a boil. Cook for 2 minutes; strain and set aside to cool.
Heat the vegetable oil in a saucepan over medium heat. Stir in the onion, and cook until the onion has softened and turned translucent, about 5 minutes. Pour the milk into the saucepan and whisk in the cornstarch. Add the butter, nutmeg, salt, and pepper. Bring to a simmer whisking constantly, then cook for 2 minutes until the butter has melted and the sauce has thickened. Stir in the hard boiled egg and corn; pour into the pie crust. Brush the crust with the beaten egg.
Bake in the preheated oven until the crust and the pie are golden brown, about 25 minutes.