Yes, you can cook the corn if you prefer the flavor over raw kernels. However, this is considered a cold to room temperature dish as everything else in it is freshly chopped and not cooked so I would recommend allowing the kernels to cool completely before tossing them together with the other ingredients. Raw corn adds extra crunch and texture to the dish whereas cooked corn will be much softer.