Substitution for fresh corn
Personally I find frozen or canned is usually much better quality taste and texture wise to the fresh cobs. Good quality canned/frozen sweet corn is picked and frozen/canned within hours of picking whereas cobs in the market could easily be over a week old by the time you get it home.

So yes, you can easily substitute canned/frozen for fresh. 

Same goes for peas.