Well if you want to know what the rules say, they are pretty cut and dry. Casting the spell is an evil act, which Pelor would probably frown upon in general, but a cleric can prepare any spell on the cleric spell list regardless of alignment or deity alignment. If said cleric of Pelor wanted to cast animate dead on someone with the intention of having the animated dead attacking a necromancer, regardless of who it is (i.e. it doesn't matter if the necromancer killed them or not), it is indeed possible.
Where do you draw the line then? That is up to you as a DM. If you don't feel it should be possible for a cleric of Pelor to animate the dead, then simply tell your player whenever he prays for that spell that Pelor won't give it to him under any circumstances. However, if you feel that a minor act of evil (animate dead is only a 3rd-level spell after all) with good intentions is within reason, especially if the cleric destroys the undead after the necromancer is dead and gives them proper burial, then feel free to allow it. Of course, I would say repeated uses of such a tactic would definitely constitute a gross violation of the cleric's code of conduct and he would lose his divine abilities and be forced to atone.
Now if I misunderstood your question and you were talking about using turn attempts to command undead, then the rules are quite clear on that issue as well. No, it is not at all possible. As a Good-aligned deity, Pelor does not grant his clerics the ability to rebuke or command undead. It doesn't matter what the cleric's alignment is. Clerics of Pelor may ONLY turn or destroy undead. If you wish to allow it on a case-by-case basis, then that is your prerogative as a DM, but the rules-as-written do not allow it.
Now a cleric of Boccob (who is a Neutral-aligned deity) with a neutral alignment may choose at character creation whether his character turns or rebukes undead. But once this choice is made, it cannot be changed. But a Good-aligned cleric of Boccob cannot make this choice, as the cleric's alignment dictates that he is only able to turn or destroy undead.
In summation, if the cleric of Pelor wants to really end the suffering of the undead, he should destroy them and kill or capture the necromancer (not necessarily in that order). Any other option is house-ruling it.