Yes, you can substitute red onion with shallots in this recipe. Shallots have a slightly milder and sweeter taste, which can add a different flavor profile to your heirloom tomato salad.