The guy fielding the ball has priority, but it depends on the situation. If it's first and second and less than two outs, then if an umpire rules it was intentional, you have an answer to a trivia question: How can a fielder be credited with an unassisted double play without touching the ball.
If it is ruled unintentional, or there is a runner only on second, then the runner is out, the batter is awarded first base and if there is also a runner at third, he must return to third base. If there is a force play and the runner is determined to have intentional tried to break up the double play, either by letting the ball hit him, or by interfering with the field, then the umpire is instructed to declare a double play.
If there are two outs, and the batter interferes with any attempt, for example on an attempt by a runner on third to try to score on a passed ball or just s simple steal, then the batter is out. If there are less than two outs, then the runner is declared out. The difference with two outs, is who would lead off the next inning.
All of that is in 6.01. But there are about six paragraphs that apply.