Preheat oven to 350 degrees. Grease a 1-1/2 quart casserole dish. Note that this dish will need to fit in a large baking pan or roasting pan, with hot water that comes halfway up the outside.
If corn kernels are frozen, defrost and drain well. Boil about 2 quarts of water and set aside for the water bath.
Heat oil in a large saucepan over medium heat and add corn kernels. Cook, heating corn and evaporating any liquid, about 5 minutes. Stir in coconut milk, salt, sugar and cayenne.
In a small bowl, whisk together cornstarch and 1 tablespoon of cold water to dissolve. Whisk the cornstarch liquid into the corn mixture, bring to a boil, reduce to a simmer, and cook until thickened, about 5 minutes. Pour into a large bowl to cool slightly.
When corn mixture has cooled slightly, gradually stream in eggs, whisking them into the corn mixture. Pour into prepared casserole dish. Place casserole dish in larger baking pan or roasting pan. Fill outer baking pan with hot water to reach halfway up the sides of the casserole dish.
Bake in preheated oven for 55 to 60 minutes, until pudding is mostly firm, center jiggles slightly, knife inserted in the center comes out clean and top is lightly browned around edges. Remove casserole dish from water bath, and serve warm.