Sort of.
They are both the PG1 gearbox. However, they have different ratios/final drive - so you'd have to rev the guts out of a diesel with a petrol box and could take off from stand still in 3rd in a petrol with a diesel box (possibly!).
The diesel spec box also has more robust internals to take the torque of the diesel engine - a petrol spec box on a diesel would fail quicker.