Not true. Food is mostly a non-countable noun. It is very rare to be referencing the word "foods", but it is possible. In this context, it is understandable. "Spicy foods" could be different dishes/ingredients that are all spicy.
Can one say Mereka tidak bisa makan makanan yang pedas?
A previous question included yang
I believe it was Saya tidak suka makanan yang pahit.
I know what yang means, but still confused on when it is necessary.