Without hearing your ex's side of things, it's impssible to be certain how a civil court would rule if asked to decide who owns the animal. (For example your ex might say that you gave her the dog as an unconditional gift; you'd then have no right to demand its return if the court believed her account).
However if you genuinely believe that the dog is yours (because you paid for it and you didn't transfer title to it by gifting it to your ex) you can take the dog without fear of being prosecuted for theft. 'Theft', as defined by the Theft Act 1968, has to involve 'dishonesty'. and Section 2 (1) of that Act states:
"A person’s appropriation of property belonging to another is not to be regarded as dishonest . . . if he appropriates the property in the belief that he has in law the right to deprive the other of it . . . "