Letting children, especially young children, and pets, especially new ones, play can be a little nerve-wracking. The foremost worry is for the safety of the children, of course — it's more likely that an animal would physically hurt a child than the other way around. Unfortunately, kids can hurt pets too, and what's more, they can antagonize a pet to the point the animal will act out.
This is mostly due to two factors. First, children are still growing, learning, and testing boundaries, coupled with still learning how to verbalize their thoughts and needs. Second, pets can't verbalize at all, making it more difficult for them to communicate when they don't like something, want certain behaviors to stop, or are hurting. As a parent, you need to step in and fill this fundamental gap and help them understand each other.
Keep in mind that some animals simply aren't comfortable around children, and that's okay. When adopting a new pet, especially if it's older, make sure to talk to the shelter or rescue organization staff to make sure the animal is safe to live with kids. Similarly, if you already have kids and kid-friendly pets but are ready to adopt a new pet, make sure to ask if the animal is also comfortable with other animals. Bringing a pet into a home where it's uncomfortable will only make them more and more stressed, and thus more likely to hurt someone.