Corn is a generic term for grain.
From OED –
corn, n.1
Etymology: Common Germanic: Old English corn corresponds to Old Frisian korn (East Frisian kôrn, kôren)
I. gen. A grain, a seed.
Whereas maize is a particular type of grain.
From OED –
maize, n. (and adj.)
Etymology: < Spanish †mahiz (now maíz ; first attested 1500 in Columbus's diary, although slightly earlier in post-classical Latin as maizium )
a. A cereal grass of Central American origin, Zea mays, having a terminal male inflorescence (the tassel) and axillary female flowers that form starchy grains (caryopses) embedded in rows in a central core (the cob);
So in regions where maize is the predominant grain people will use corn as the terminology to describe it.
Corn on the cob, is simply grains on the cob of maize, but corn has become synonymous with maize.