If you have not eaten any corn and you have corn in your poop it may actually just be mucus or other undigested foods in your poop that appear as corn.
However you may have also eaten foods that contained corn that you wasn't aware of that contained corn.
Although we cannot digest corn fully we still eat corn as ti does have other nutrients and compounds that our bodies can and do breakdown and digest.
So while our bodies don't fully digest the corn we do still get some benefits from the corn and it does provide us with some nutrition.
Corn is high in cellulose, which is an insoluble fiber that the body cannot digest.
However, the body breaks down the other components of corn.
Chewing corn for longer can also help the digestive system break down cellulose walls to access more of the nutrients.
Corn might look untouched when it passes out in your stool.
But your body does digest parts of it.
The outer skin of the kernel contains cellulose, which your body can't break down.
The fact that it's hard to break down corn is actually ideal for the plant.
The outer coating owes its resilience to a tough fiber called cellulose, which humans don't have the proper enzymes or gut bacteria to digest.
Nutritionally speaking you could not survive on corn because if you tried to survive on a diet of nothing but corn you'd soon die of malnutrition, initially succumbing to diarrhea and mental deficiencies, depression, skin lesions and over a longer period of time, developing full-blown pellagra due to a lack of niacian/Vitamin B3.