I read that for almond trees, you should plant another tree of a different variety. That confuses me.

I had always thought that if you planted different varieties of the same kind of plants near each other that the fruit/vegetable would cross-pollinate and wouldn't bear 'true'. jFor instance, if you planted a bell pepper near a hot pepper, the hot pepper wouldn't be as hot, and the bell pepper wouldn't be as mild, because they would end up sharing qualities.

Is that only for some kinds of fruits/vegetables?