Assuming both are equally taking advantage of best bore/stroke combinations for torque development, that's largely true, gas or diesel. It's equally true that a typical inline 6 engine is not reliably capable of the higher RPM peak HP of a V8...
BUT, the higher typical upper RPM limit of the typical V8 engine allows use of a higher differential gearing that enhances off-the-line acceleration, while still delivering excellent cruising and top speed RPM. Here's a clue - WHY did the early Dodge/Cummins 1st generation trucks commonly use 3. 07 differential gearing?
Easy - because the then-limited 2500 RPM redline FORCED the tall gearing for reasonable freeway speeds - that even THEN were about 80 MPH tops!
Perhaps not always the best compromise in a purely work oriented usage, but for many, V8 power is often a welcome trade off in *all around* usage - as in the case of most truck owners.
It's undeniably true that drag race records are established and held by V8 engines - while the vast majority of hard working OTR rigs are inline sixes...
They each have their areas of excellence - and so far, trying to switch their strengths, has been pretty much an exercise in futility - as in the case of Ford trying to get unobtainable reliable power from their infamous 6. 0...