In the comics, the two "pet" walkers are identified as Michonne's boyfriend Mike and his best friend Terry.
As explained in The Walking Dead Wiki:
In the early stages of the apocalypse, Michonne runs on foot to her house. This attracts a street full of zombies to follow her. While she arrives home, she meets her boyfriend, Mike and his brave but idiotic best friend, Terry. A zombie tries to break in but Mike kills it. In the process, Mike becomes bitten. At that time, Michonne bandages Mike, who is unaware that he is infected. That night, Michonne searches a neighbor's house for supplies and discovers her trademark sword. She gets pinned down in the house during the night and returns home the next day, finding that both Mike and Terry have become walkers. She manages to survive their attack and lock them away. Her noisy encounter causes her street to become overrun. Michonne becomes trapped and runs out of food. She notices walkers don't attack one another and hacks off the arms and lower jaws of Mike and Terry. She chains them up by their necks to use them as escorts for an escape that was successful. Michonne says her final words to the zombified Mike and Terry, to help remember who they are, and because she has no one to talk to.
In the TV show, the "pet" walkers are again identified as Mike and Terry. Whether Mike is her boyfriend or husband is a little unclear, but she also had a three year old son named Andre Anthony. At this time, there has been no revelation as to how any of them died. Contrasting the comics, in this version, she turns them into "pets" so that she can keep them with her, and only later realizes that they help ward off other walkers.