Is there any situation that makes it possible for a single player to have two consecutive at bats for their team? I was imagining this could happen by the batter getting on base, and then being replaced by a pinch runner. Then, the original batter pinch hits for the next person in the lineup. Is something like this possible?
No, it's not possible, at least as you explain it.
In baseball, once you're removed from the game, you're done for the day - at least in mlb. In some other leagues, there may be re-entry permitted, but for example in high school baseball they must occupy the same position in the batting order as they originally did. No ruleset I'm aware of allows arbitrary re-entry. If it were possible, then you'd simply have your best hitter bat repeatedly.
There are a few cases that are adjacent, though.
If the inning ends on a caught stealing or similar, while a batter is at bat, they will again be at bat in the following inning, in a new at bat. The former at bat didn't technically occur, though, and won't be charged to their stats.
In mlb, in the 10th and subsequent inning, the batter during the last out will start the inning on 2nd base. They don't get credit for an at bat, though, as they don't bat, they just stand on 2nd automatically.
A batter cannot take two full consecutive plate appearances legally. (As Joe noted, if an inning ends with a play on the bases not involving a ball the batter struck, the same batter will start the next inning.) However, if a batter bats out of order and the violation is caught and the same batter is due to be the next batter, then they may appear at the plate twice, seemingly batting twice.
Perhaps an example will help: A team has a batting order of A, B, C, D, E, F, G, H, I. After I bats, A is due up again. However, B appears at the plate instead. After B completes a plate appearance, the defense claims an out of order violation. An out would be called, and any other effects would be nullified (e.g. base runners would be returned to their previous bases, runs scored removed, etc.; if the batter had reached base they are removed). B would then be due to bat. Technically however, A is the batter considered to have been put out, so from a rules perspective B is not batting twice in a row.
This umpiring page explains the rule: https://www.umpirebible.com/index.php/rules-batting/batting-out-of-order
While somewhat of a stretch and technicality, the intentional walk rule could lead to a batter batting twice in a row.
Beginning in the 2017 season, teams no longer need to throw four balls in order to intentionally walk a batter. Rather, the manager can signal an intentional walk from the dugout at any point during a plate appearance, putting the batter on first base automatically.
With that in mind, a batter could get on base, and a team can intentionally walk 8 batters in a row without throwing a pitch to these individuals. From here, the same batter would be up.
This is incredibly unlikley to happen, but would lead to a batter being up to bat twice in a row.
It is possible if the batter comes up as an improper batter and the defense does not protest.
If batter "A" has a plate appearance (perhaps at the end of an inning) and then goes to bat at the beginning of the next, it's up to the defense to notice and appeal.
If "A" completes a second consecutive bat and the defense then does not appeal before the next batter receives a pitch, the player becomes a proper batter and play continues as if the appearance was correct.