Not necessarily a food, but nicotine can create insane dreams. People who are in the process of quitting cigarettes can have really disturbing dreams if they fall asleep with the patch.
So true. I had some wild, wild rides at night while wearing the patch (which I wore 23hrs and removed before exercise)
Source is my personal experience. I'm positive that if I go to bed with full stomach the probability of nightmare increases. Also some food like dairy triggers nightmares I think. Of course, all circumstantial, I didn't try a scientific study.