It's only logical that it would be based on turn order. The production is calculated on the beginning of each turn, and so if two people, A and B, in that turn order, are both slated to complete a wonder in 1743, then A's production will go into the wonder first.