Hi Alex,
My guess is; as long as it's agreeable to both players, it's okay. I'm sure there are situations, when two players remain, that could raise issues about collusion. However, in your example, both players are all-in pre-flop. Short answer; As long as only two players are involved, and it's a cash game, and they both agree...why not.