In a large pot of boiling salted water, cook the corn for 3 minutes until the starchiness is just gone. Drain and immerse it in ice water to stop the cooking and to set the color. When the corn is cool, cut the kernels off the cob, cutting close to the cob.
Toss the kernels in a large bowl with the red onions, vinegar, olive oil, salt, and pepper. Just before serving, toss in the fresh basil. Taste for seasonings and serve cold or at room temperature.