Using animals to attack walkers would be an extremely ineffective tactic.
Depending on size, dogs may attack by attempting to knock a human to the ground, or they may attack by biting, and then tugging and worrying with their teeth. This is extremely painful to a human, and either the shock of the pain or the weight of the dog frequently knocks the victim to the ground.
This would not be very effective on a walker. Even if the dog knocked the walker to the ground, the walker would simply grab the dog, and attempt to pull it close to its mouth so it could start eating it (we've seen multiple instances of walkers eating animals, ranging from raccoon to horses, so its fairly certain that a dog would be a welcome snack).
The best a lone dog could hope to accomplish against a walker would be to rip large chunks of flesh out of it. The likelihood of biting-and-worrying attacks from a dog disabling or destroying a walker are pretty negligent, while the risk to the dog is fairly high.
However, dogs are at their most dangerous when attacking as a pack.
Tactics for a pack tend to be a bit different, in that prey is typically surrounded (assuming it isn't fleeing, which wouldn't be the case with a walker), and harried with feints from all sides, until the prey is on the ground (usually after being hamstrung or pulled down from behind).
This would likely be quite effective against a single walker. The feinting attacks would reduce the risk to any single member of the pack, and once on the ground, the pack would be able to do a lot of tearing damage with little risk of the walker being able to force any of the dogs near its mouth.
Unfortunately, walkers also show pack tendencies. While they don't attack in a concerted fashion, the simple presence of multiple walkers would be a major problem for a pack of dogs.
While the dog pack surrounded one walker, any other walkers present would likely be trying to grab any of the dogs. It would be difficult for a pack to keep one walker surrounded, while evading multiple other walkers.
Even if they did take down one walker, they would be extremely vulnerable to attack from other walkers while they savaged the downed victim.
Realistically, it seems unlikely that dogs would be at all effective against walkers unless the dogs outnumbered them at least 3-4 to 1, or if the walkers were extremely scattered.
Other animals might be more or less effective in fighting walkers in varying amounts, but all but the most massive or well defended would be quickly overwhelmed by large groups of walkers.
To address specific ones mentioned:
- A bear would probably be very effective 1-on-1, or even be able to take out small groups of walkers, but it would likely take quite some time to train it, and would still be a hazard to any humans nearby, no matter how well trained.
- A crocodile would be very effective at killing a single walker, if the walker approached too closely to the water where the crocodile lurked. I don't believe you could "train" a crocodile, though, and it wouldn't be effective outside of the water: the effectiveness of a crocodile vs. a walker would come from the "death roll", which typically happens once a victim is dragged into water, and which would likely dismember a walker quite quickly. A crocodile is not going to destroy one walker, and then immediately go after another, however, so its not terribly practical.
- An elephant would likely be the most useful in a fight against walkers. A charging elephant would likely be able to knock down and trample large groups of walkers. However, it seems that an elephant's skin is thick (up to 1 inch), but very sensitive. I did find one site that claims that the skin is very thin along the abdomen (presumably underneath the animal, as opposed to the flanks), mouth, ears, and anus. I'm not sure if a walker could bite through the skin of an elephant, but elephants are pretty intelligent, and walkers were biting it in sensitive spots, it would likely become difficult to get the elephant to continue to engage large groups of walkers.
This all assumes that these animals are not subject to the effects of the virus, of course.
One final difficulty with the idea of keeping such animals as guardians is food. Even if you assume that walker flesh is edible to animals that eat carrion (which seems a BIG assumption to me), keeping a steady supply of this meat without overwhelming the animal would be difficult.
Keeping an elephant supplied with sufficient food is completely impractical. According to the Smithsonian National Zoo, an elephant would require hundreds of pounds of food each day:
Our elephants each eat between 125 and 175 pounds of food a day. The bulk of their diet is hay. They also eat fruits, vegetables, and a fortified pellet food. In the wild, where they must expend a great deal more energy to find food, elephants eat two to three times this amount of plant material, from grass to trees.