Defense is about the only thing you can train to avoid fouls. They are partially dependent on a hidden skill trait called "aggressiveness" this trait gives players a higher chance to "make things happen," to give up a foul and to draw a foul. I've also heard people say stamina can affect it if it's late fouls. But the biggest thing is when your players are outmatched, they foul because they can't keep up. And sometimes the coach uses fouling as a tactic in endgame situations, which can bump up your foul rate. But I say train up defense and make sure nobody's got super low stamina. That's about all you can do.