Can my semen analysis be affected by what I eat?

Not likely. The most important thing is to not ejaculate for 48 hours prior to the collection. This ensures that counts are accurate.
Possibly. A healthy diet with lots of fruit and vegetables probably affects semen analysis beneficially. Smoking and excessive alcohol consumption will have the opposite effect.