Terroir is a loosely defined word, with several layers of meaning.
(A) The agricultural-scientific definition: Terroir is the set of all environmental factors that affect a crop’s phenotype, including environment, soil bacteria, local insects, farming practices. The fact that a crop is influenced by its surroundings is non-controversial.
(B) The crop-flavor definition. Terroir gives a distinctive flavor to the local crops, so that one can distinguish crops by region based on this flavor.
(C) The wine definition. It is believed that the distinctive characteristics of crops survive fermentation into wine. Even when wines from various vintages are mixed together, it is claimed that a local wine has a distinctive terroir. This claim is more controversial. There are a number of scientific studies on this issue, but few are blind taste tests.
(D) The distillation claim: Recently a new claim about terroir has developed. It says that the distinctive characteristics of crops survive fermentation, as well as distillation into spirits (as in the production of whiskey or rum.) Even when barrels from different vintages are mixed together, it is claimed that the resulting whiskey or rum has a distinctive terroir. This claim is much more controversial. I am not aware of any evidence that this claim can be substantiated.
When it comes to foods, and wine, the first two levels of the terroir idea are the basis of geographical indicators, especially the Appellation d’Origine Contrôlée, AOC.