I'm amused by something like smoked and cured bacon or gammon joints being in the 'sell by' when they're about to hit their dates, as smoking and curing are preserving methods.
You can sometimes find these in the cabinet with a sell-by date 3 months or so in the future, so I can't believe they'll be OK the day before but bad the day after
On the other hand I'd be far more worried about something like poultry or seafood where the sell-by date is a much shorter period.
As for tinned food, I remember reading in one of the war comics I used to read as a 10 year old about how during the First World War, sometimes how if they ran out of duckboards to make paths and roads through the mud in Flanders, they'd use whatever they had to hand and there were sometimes roads and paths paved with bully beef tins.
And even 30 or 40 years later French & Belgian farmers would uncover these whilst ploughing the fields and they'd eat them.
On the other hand, the Franklin expedition sent in 1845 to discover the North West Passage across the top of Canada through the High Arctic had their ships trapped in the ice and were all lost, even though they were, for the time, very well equipped and had lots of newfangled tinned food so should not have starved.
They recently found some of the bodies buried and preserved in the permafrost, tested them and found huge quantities of lead in them, slowly being lead-poisoned as that was the method used at the time to seal their tinned meat.