You can only get a dog once Mirabelle has two hearts (5,000 FP) and you have asked Gannon to build a bridge to W. Town, where the Witch Princess lives. Go whenever it's rainy, drizzly, or snowy outside.
Mirabelle will come up behind you and say that a dog needs someplace to stay so it doesn't get sick. She will ask you to take care of it and you nod. You can buy pet food at Mirabelle's shop.