Mash the garlic and chiles in a mortar and pestle until finely smashed (or mince with a knife).
If using fresh corn: Trim the bottom end off of each corn cob to create a flat surface. Place a small bowl upside down inside a larger bowl. (This helps catch all the little corn pieces!) Then stand each ear of corn and, using a sawing motion, cut off the corn from the cobs, getting as close to the cob for maximum corniness (but not so close that you cut off and include the woody parts of the cob itself).
Separately, combine the mushrooms in a bowl with 2 tablespoons of the oil, salt, and pepper.
Heat a large skillet or wok over high heat. Add the mushrooms and cook, flipping once, until crisped, 2–3 minutes per side. Remove to a plate, then add the corn and cook, stirring only once or twice, until lightly charred, 3–4 minutes. Add to the plate with the mushrooms.
Add remaining 2 tablespoons of oil to the skillet, then add the garlic-chile mixture and cook until fragrant, about 30 seconds. Increase the heat to high, then add the mushrooms, corn, oyster sauce, and soy sauce, and cook, stirring, until just warmed through, 1–2 minutes. Add the basil and cook until wilted, about 1 minute. Serve with rice.