You can, but the foil helps the cob of corn steam evenly within the packet and ensures each kernel is infused with flavor. If you don’t want to use foil, baste the corn in melted butter and seasonings, then place the cobs directly on the preheated flat-top and cook for about 10 minutes, occasionally turning and brushing with more butter to keep the kernels moist.