The book Mud, Blood & Poppycock has quite a lot to say about feeding in the trenches...
Quite a lot of bollox talked about this, mostly based on the Blackadder rat episode..
Troops were normally only ever in the front line trenches for a day or so. Cooking was not allowed so packed food was taken up and eaten - bully beef and jam sarnies and bread. British trenches were generally in a much better state than French or German ones, as they kept troops forward for much longer periods.
Most cooking would have been done centrally in the rear of the trench area. Field kitchens were the norm, and were run on quite hygenic, if not basic lines, and had been since the Crimea. As has been pointed out, there was only limited refrigeration (It did exist) so most meat was tinned, usually bully beef. There was however no problem with veg such at potatoes or carrots. In order to cook in bulk with limited equipment, most food would have been boiled or steamed, so mostly stew and duff which is easy to keep warm and serve.
The diet would therefore have been pretty boring, but sufficient. There was never serious shortages on the Brit side (unlike the Germans, who WERE starving by the end of the war). This is not to say that in some cases people went short because of resupply problems (or just bad admin), but this was the exception rather than the norm. Bread was baked daily in the field, and the Army ran field abbatoires and butcheries all the way through the war. There were even regimental lemonade factories set up by some teetotal COs...
You have to see these things in their context. Domestic life in the early 1900s was a lot simpler (although harder) than today, however much of the food manufacturing and preparation was done much closer to the populance than now. There would have been a lot of bakers, butchers etc in the ranks whose skills were utilised. The equipment and techniques used in british army catering did not change that much between 1890 and 1980... 6 foot tables, dixies, Soyer Stoves and No1 Burners.. tea, bread, potatoes, stew and plum duff.
Remember, soldiers, and especially old soldiers, always moan about the food - it's part of the culture...! The "rat in the bread" story sounds like a good one to wind up the kids.. like knocking the chocolate biscuits to shake out the weevils - yea Grandad!
... but it was OK really!