No, you can test your dog to see if it's learned simple commands, like sit or stay, without fear of being arrested.
But perhaps that isn't what you meant? If you meant to ask about testing other things on animals, for instance testing for harmful effects of cosmetics on rabbits, then you need to be more specific. Cruelty to animals is illegal in many places, but how that is interpreted varies. Some countries have restriction on the kinds of testing that can be done. As far as I know, everyplace allows some kinds of safety testing using animals to see if things harm living beings, but the regulation and restrictions on that testing will be different depending on the location, the type of animal, the reason and the type of testing