If 2 people touch the ball at the same time, who obtain the score in NBA?
Although in theory its pretty much unrealistic but whoever owns up gets the 2 points. If you watch the NBA, you will notice that when it gets crowded in the paint and a player scored, the player that put his hand up is awarded the 2 points. The same would happen in your example.
If 2 players owns up to the basket, they will go through the slow motion and see which player had the most dominance of the ball (who held most of the ball).