From what I've been told, the sim computes the winner first and then fills in the details.
The only place I've ever seen this quoted is from people who are salty (or commiserating with someone who is being salty) about a perceived "unfair"/"unlucky" loss.
Just from a logical perspective, it doesn't really pass the sniff test. What's even the point of having individual player skills if you're not going to simulate individual chances / possessions based on those skills? They might as well just give you buttons to choose players based on their salary and then you slap in your desired lineup, it calculates chance to win based on relative starter-weighted salary, and then picks random bullshit stats.
It's been adequately confirmed by official sources and long term observation that there are players who have a hidden "aggressiveness" trait, which makes them more likely to both draw and commit fouls. In addition, it's been confirmed by official sources that a significant factor in determining non-shooting fouls is the OD/ID of a player, while SB has some contribution to determining shooting fouls. I would expect (though I haven't seen official confirmation one way or the other) that stamina also indirectly contributes to fouling rate, as players with lower stamina will deplete their "effective" stats faster than players with higher stamina, and thus the low stamina players will be more likely to pick up fouls as they play more minutes.