The analysis generalizes by assuming one of the countries is the rest of the world. Each country has producers and consumers of a tradeable good, wheat. The analysis can generalize by considering broad classes of products, like manufactured goods, or services.
Wheat is a homogeneous good.
All wheat, from Mexico and the US, is perfectly substitutable in consumption. The markets are perfectly competitive. We assume that the two countries are initially trading freely. One country implements a trade policy and there is no response or retaliation by the other country.