This simple tutorial will walk you through the steps required to get a pet for your kids in Hearthfire

Step 1: Buy a Plot of Land
You need to buy a land so that you can build a house for your kids and your pets. For instructions on how to obtain a plot of land, see the following guide:
How to buy land in Skyrim Hearthfire

Step 2: Build Your House
After you have purchased land, you need to build the house. For instructions, see:
Hearthfire House Building Guide

Step 2a (Optional): Add children's bedroom to your current home in a city
If you don't want to build a house right now, you can just add a child's bedroom to an existing house you own in one of the cities, such as Breezehome in Whiterun. This is done by talking to the Jarl's Steward, the same way you added other additions and decorations previously.

Step 3: Prepare your house for adoption
In order for the children to move in, you need to have a child's bed and a small dresser in your house (in addition to the double bed for you and your spouse).

Step 4: Adopt a Child
You cannot have pets if you don't have children, so now you need adopt one or two kids to live with you. For a tutorial on how to adopt children in Hearthfire see:
Skyrim Hearthfire Adoption Guide
List of Adoptable Kids in Skyrim Hearthfire

Step 5: Decide whether you want your kid to have a pet dog
There are several types of pets your kid can have, including Mudcrabs, Foxes, Frostbite Spiders, Rabbits and Skeevers. See here for a full list of pets:
Skyrim Hearthfire List of Pets your children can have

For most types of adoptable pets, the pet you get will be random. But for the dogs, you have control over the pet choice. If you want to have  a pet dog, then go get one. Bring the dog back home and talk to the kid. The child will ask you if they can keep it, and if you say yes than the dog becomes a house pet whenever you are not using it as a follower.

Note: You can have a dog as a follower regardless of whether you have kids or not. But if you want to have the dog as a house pet, you need to adopt kids.

Step 5: Getting a pet dog (Optional)

Possible dogs to adopt as a pet include:
From Meeko's Shack South of Solitude and West of Morthal
From Markarth, near stables, costs 500 gold
Armored Husky from Fort Dawnguard (Requires Dawnguard Expansion)

If you want a dog to be one of your pets, bring it home. After you enter your house with the dog, talk to your kids. The child will say it's a cool dog and ask if he can keep it. If you agree, than the dog becomes your pet.

Note: If instead of asking you whether he could keep the dog the kid doesn't want the dog and remarks something like "Stupid dog", fast travel to some far city and then come back and talk to the kid again

Step 6: Getting a random pet

If you do not want a dog, you can wait for your child to find and bring a random pet. This might take time, sometimes a day and sometimes more. When the child finds a pet he likes, he (or she) brings it into the house and asks you if he can keep it. Assuming you allow the kid to keep the pet, it becomes your house pet. There are all types of pets a kid can get, from mudcrabs to spiders. See list here:
Hearthfire Pet List

Once the kid has adopted the pet, you will now see the pet around the house, sometimes playing with the kid.