It's possible to get something in the vicinity of the C130 during WW2. The C130's predecessor, the Fairchild C123, was powered with two WW2 era P&W R2800 radial engines, each producing 2000 hp. Presumably, the design and number of engines could have been scaled up.
Remember that a defining characteristic of the C130 isn't it's payload, it is the rough field landing capability, which includes STOL. I've been in a C130 when it was practicing short field landing and takeoff, and the experience was... dramatic. When it hit the runway, it really did hit the runway... with a bang.
A piston powered transport with somewhat the same capabilities of the C130 was produced in the 1950's, the Blackburn Beverly, used by the RAF. The Beverly was built with WW2 technology, and was powered by WW2 vintage Bristol Hercules and Centarus radial piston engines.
The Beverly was abandoned in favor of the turboprop Armstrong-Whitworth Argosy, when it became available, just as use of the C123 was phased out as the C130 became available in sufficient numbers. The greater power and substantially lower maintenance requirements of turboprops made them the logical choice when they became available.
Given that the C130 was initially produced with Allison T58 turboprops, at 3500shp, a four R2800 C130 would have had a power deficit. The larger P&W R4360 at 3000 hp could be used, although it was still having development problems during the war.
A WW2 vintage C130 would have had longer takeoff and landing, and a lower payload, due to the lower power available and the heavier weight of the power plants, but it was possible with the technology of that day.
Would it have been produced? Given that WW2 had its own unique requirements, probably not. Aircraft production was centered around warplanes and transports with long range, such as the Douglas C54. By the end of the war, the Allies had prepared field construction down to a fine art and the teams in place to build those fields quickly in both theaters, so the need for a large transport with rough field capability wasn't as evident.
Where the C130 really became valuable is in lower intensity conflicts that followed WW2, where expert runway construction teams aren't available on short notice, and the front lines of combat aren't nearly as well defined.
So, to a degree, the changing nature of armed conflict defined the need for the C130.