Is there a rule in MLB that limits the number of pitches the batter can foul off?

Former Giants first baseman Brandon Belt holds the current record for most foul-offs and longest at-bat since 1988, when such records began to be kept. There is no limit to the number of pitches a batter can foul off during an at-bat, and Belt’s impressive feat is evidence of that. In a game against the Angels on April 22, 2018, Belt fouled off 16 pitches during his 21-pitch at-bat in the first inning against Angel pitcher Jaime Barria. The at-bat lasted over 12 minutes, finally ending when Belt flied-out to RF.