Cory Stockton (Mumper on the Mists of Pandaria beta forums) has posted a clarification to a forum thread about pet battles and PvP that explains exactly what you pet battle collectors on PvP servers can expect.
The fact that players are vulnerable to PvP attacks while in a pet battleis intentional. However, a couple features that go along with this are not implemented yet.First off, the exact pet you were fighting when you were broke out of pet battle will be respawned. Same quality, stats and skin color. Second, you will get a 3s damage shield that absorbs 50% of incoming damage to help negate the fact that you need time to recover after exiting the pet battle interface. Both of these will be in for the next build.
We feel its very important to keep the PvP aspect of the game intact and if you choose to play on a PvP server, you will certainly be fighting for those rare spawns. (This rule effects PVE servers as well but only in contested areas.)
So yes, if you’re on a PvP server and you intend to take part in pet battles and collecting wild pets, then you’ll have to contend with PvP in the world. The fact that you’ll at least get to try again after you kill that rogue has to be of some comfort.