Question: Are there any diet or lifestyle changes I can make to prevent hair loss?
Answer: For the overwhelming majority of men, diet and exercise has no effect on hair loss. There are certain instances where there are severe vitamin deficiencies, which typically happens in the Third World in very poor environments where men can lose their hair. And similarly, in periods of extreme medical stress, you can have hair loss as well. But that is the overwhelming minority of cases.
In general, diet and exercise have little to do with hair loss.
Unfortunately, hair loss is most directly correlated to your genetics and that is something that you can't change. So genetics predetermine the hair loss that you will be having over the period of your life.