When you visit bareshade, there are chance you trigger a scene with the dog, and if your inventory had meats, you can feed the dog, after fed several times, you would have the option to take the dog home.
You can build the doghouse and stable in the tools icon, you needed 5 and 20 planks to build them.
For the horse, you need to finish the bandits event first to open River's Bank (location), when you take a break there you would meet Torben (the merchant), there would unlock the topic of horse.