In baseball, a player can replaced by any other player who hasn't yet appeared in the game. Can this replacement be made after a player has started batting and is still at the plate?
Absolutely. From the official rules:
Basically, any player, offense or defense, can be substituted for another, when the ball is not "in play."
The basic reason is injury. Suppose (and this would be a freak accident), a batter was hurt while hitting a foul ball. The manager might want to use a pinch hitter, rather than having the hurt batter continue to bat and run.
The new batter would inherit the ball-strike count of the old batter. As mentioned in another post, the new batter would be credited with the ultimate result EXCEPT when the original batter had accrued two of the three strikes in what ultimately becomes a strikeout.