Well I think along with the variety, the growing climate and soil type does make a difference to flavor.
"firmness, Total Acidity and Electrical Conductivity were season dependent, whereas soluble solids content did not change between cycles. In some varieties, the dry weight, juiciness and total sugars were affected by climatic conditions" https://www3.interscience.wiley.com/journal/118610416/abstract?CRETRY=1&SRETRY=0
that's just one experiment I found, and not a field trial. But it does seem pretty intuitively obvious to me that the same variety of tomato grown in hot dry conditions might have different flavor, than one grown in cooler, moister conditions.
For hot peppers, they say that is a good thing, that you get more heat and flavor growing it in drier conditions...