Consider a 2-on-2 game engine designed such that each team was most productive when that lineup had 1 guard and 1 forward. Suppose that roster size was 4. It would make sense to keep 2 guards and 2 forwards on that roster. If the starting guard (or forward) fouled out early, the team would be screwed because the remaining guard (or forward) would have to play the entire rest of the game with no sub *or* a lineup of two forwards (or guards) would have to be rolled out. Subbing due to foul trouble, to spread the fouls out over the two guards (or forwards), would be the rational strategy.
That's enough to demonstrate that subbing for foul trouble should at least be entertained in a 5-on-5 game engine, assuming we believe that a balanced lineup is better than e.g. a lineup of 5 bigs. Whether it is actually the right strategy depends on team composition. I don't know where the thresholds are, but I could imagine that:
1) If you have 2 PGs of comparable skill (at PG), and a bunch of crap PGs, subbing both (or at least the starter) due to foul trouble would be a good idea. If you don't, and one of the 2 foul out, you are left with one playing extended minutes and fatiguing, or else playing the crap PGs.
2) If you have 1 incredible PG, and then a bunch of crappy ones, subbing the starter (at PG) due to foul trouble might be a bad idea since that starter fouling out is really no worse than him getting subbed in, so you really just want to keep his minutes up. Subbing out due to foul trouble might even be worse than not, since he might pick up foul that gives him the hook 30 seconds after he subbed in, so you are squandering several minutes of fresh/fairly-fresh starter by subbing him out.