Excessive eye gunk can come from feeding a too high protein diet. The red staining is a combination of yeast and bacteria. I found that info years ago, and can't find the exact link again... but I'm sure you could 'Google' Groomimg Maltese, or similar and find many sites....
Your vet is right too. There is a condition in small dogs where their eyelashes grow in backwards and irritate the eyes. But this is not always the case.
Anytime a foreign object like a hair gets into the eye, mucous will be produced and will engulf the offending object to prevent it from damaging the eye.
Eye staining is a vicious cycle. The outer eye area needs to be gently cleaned and all debris removed. Antibiotic eye ointment should be used in the eyes and on the surrounding lids, to get the bacteria under control.
And to answer your question... haha... here's a link to many sites that cite diet as a cause of eye discharge....
eye gunk and diet - Google Search=