No, this formula is a fundamental relationship that applies to any rotating power source. It's derived from the basic definition of a horsepower: the ability to do 33,000 ft/lbs of work in one minute. Some fella named "Watt" a long time ago figured out that's how much work a horse can do in a minute.
If you take a shaft that's spinning 5252rpm, a point at a 1 foot radius from that shaft will travel 33,000 feet in a minute's time. If it also has a force of 1lb, now you have 33,000ft/lbs in that minute, which is the definition of a horsepower. So that's where the 5252 comes from. It's literally 33,000 divided by the circumference of a circle that has a 1 foot radius (33,000 / (2*pi))
If you take your actual torque and multiply it by your actual rpm, and then divide it by this special rpm where 1 ft/lb = 1hp, you get your actual horsepower. Essentially, you're scaling the result to meet the definition of what some horse could do a long time ago. Conceptually, it's convenient to think of horsepower as just (torque * rpm), i.e. the combination of the two.
So it has nothing to do with the engine type, it applies equally to handheld electric drills and steam locomotives and the rear axle on our trucks.
If someone ever hands you a dyno sheet where torque & hp aren't the same at 5252rpm, and both sides are scaled the same, something is wrong.
I dove into all this because some folks seemed to think that torque is somehow a better metric of towing performance than horsepower. It's not. It's actually just a component of horsepower. Typically, when we say a motor has a lot of torque, really what we're saying is that it makes it's horsepower (the parameter that matters) without having to turn a whole lot of rpm. That reduces frictional losses and wear. But a motor with more horsepower and less torque, like the 8.1, will out tow us any day of the week, let's not kid ourselves. I say that as devout diesel fan, too, I've had only diesel pickups for 10 years now. But it's a simple fact of physics.