What looks like the elephant's front knees are actually its wrists. There's a popular internet factoid which states that the elephant is the only animal which has four knees. But it doesn't; it has two knees at the back, and elbows and wrists at the front, exactly like other quadrupeds. Elephants, horses, dogs and all other quadruped mammals have two knees and two elbows. Almost all mammals have basically the same skeletal structure because we are descended from common ancestors.
All species evolve differently. Once on a different path to another species (by definition) whatever random mutation solves an issue for you and improves the chances of creating another generation becomes your species' solution to that problem. Whilst no expert on the elephant question, I don't find it implausible that a joint gets modified along the way.