Set an oven rack about 6 inches from the heat source and preheat the oven’s broiler.
Shuck corn and remove the silks. Cut off the base of the stalk and slice kernels off the cob. Transfer kernels to a rimmed baking sheet. Add green pepper and shallot. Drizzle with oil and season with salt and pepper. Toss and spread out in an even layer.
Broil in the preheated oven until fragrant, about 5 minutes. Stir and spread back out on the sheet. Continue broiling until corn starts to brown, about 5 minutes more. Cool for 5 minutes.
Transfer vegetables to a large bowl. Add mayonnaise, lime juice, and cilantro. Stir until vegetables are evenly coated. Gently fold in avocado.