maxangle=arctan(B/A)
I've thought about this before; I think it would be a fun problem for a high school physics class.
First thing: as has been noted, real life is hard to pin down; too many variables. Mathematicians and physicist will usually develop a simplified model that will allow them to make reasonable estimates that they can apply to real life. That's what I'll try to do.
First, we need to make some assumptions that simplify the problem.
1) no motion.. the truck is stationary, no rocking, rolling, bouncing, etc.
2) no suspension.. no springs, the tires are made of wood/steel.
3) for now, let's just consider a two dimensional problem. i.e. rolling over sideways. our conclusions will still apply in three dimensions, but the analysis is more complex.
then we decide what will determine when the truck rolls over. my analysis suggests that the truck rolls over when the line from the center of mass to the center of the earth (i.e. down) falls outside of the rectangle defined by the wheels.
We know where the wheels are. We know where "down" is. So the hardest part of this problem is, as has been indicated above, pinpointing the center of mass of the vehicle. First, let's note that it IS difficult to know precisely where the center of mass is. but I think we can make a reasonable estimation.
The center of mass should be very near the right/left center line of the vehicle. Otherwise, the vehicle becomes less stable. It also seems reasonable because the vehicle is nearly symmetrical side to side.
The location of the CoM from top to bottom is perhaps the most difficult. I estimated mine to be roughly about the height of the outside door handle. I don't think it would really be higher because the vast majority of the 2-2.5 tons of the vehicle rides between the frame and the hood (unless you're carrying several hundred lbs on the roof).
We can ignore the location of the CoM front to back because we are only dealing with two dimensions. This would become important when expanding the problem to 3D.
From this we can take two measurements. 1) CoM to the ground. In my case I got 39 inches from the ground to the door handle. 2) the distance from the centerline of the vehicle to the outside of the tires (I got 33 in.). We can draw a right triangle and determine the angle of the sidehill relative to horizontal by taking the arctangent of the (2) divided by (1) (i.e. angle=arctan(33/39). For my truck that yields about 40 degrees.
Back to our assumptions. A flexible suspension and rubber tires will decrease the maximum angle that the truck can sit on. As noted above, the downhill side will compress and the uphill side will relax causing the truck to sit at a steeper angle than the trail surface. Any motion the truck undertakes will also increase the likelihood of rolling. Imagine moving at 10 mph and having the upper tires hitting a rock. This could, of course, throw the truck over. We've also had to assume a stable load. If your load suddenly shifts to the downhill side, that could also throw you over. From this you'd need to build in a comfortable safety factor to prevent rolling. The amount of "cushion" you leave yourself is probably best determined from experience, as others have noted. Just be sure to remember that this is an idealized way of predicting when the truck will tip over and will tip over sooner in real life.