I wonder if portion size is comparable.
We may have inflation in more than one sense: prices have gone up, and perhaps the size of burgers and hot dogs have also increased.
No doubt I can find portion size clues if I look around. Haven't done so yet.
Restaurant portion sizes have definitely increased - a lot - since the 1940s-50s. Maybe some minor pullback the last few years but still way larger than back then. A McDonald's Quarter-pounder was considered very large, that was in 1971, many sit-down restaurant burgers today are 5-8 oz.
If anything, I think they've probably decreased ("shrinkflation").
One other thing to compare is business and health regulations. Compliance with that is certainly more involved and costly today than in 1940 and would account for part of the price.