This is a very interesting question, because I actually believe that there are far more similarities between these two characters than we would at first suspect. Clearly, overtly at least, they are very different. Don Pedro is a legitimate son, and Don John his bastard half-brother, which of course means that he will never possess the same power and prestige as Don Pedro. In addition, we know that Don John has just tried to mount a rebellion against his brother, which has been repressed. Don Pedro is seen as representing law and order, whereas Don John himself admits when we first see him in Act I scene 3 that he is "a plain-dealing villain," setting the two characters in opposition with each other.
However, in spite of the way that we might easily conclude that one is "good" and the other "bad," let us focus on the way in which they are similar. One of the key themes of this play is that of deception, and we can see that both Don John and Don Pedro show themselves to be masters of deception, though of very different kinds. Don Pedro at the end of Act I scene 1 swiftly tells the lovestruck Claudio that he will assume the guise of Claudio and woo Hero for him, effectively deceiving Hero about his identity:
I will assume thy part in some disguise,
And tell fair Hero I am Claudio.
And in her bosom I'll unclasp my heart
Amnd take her hearing prisoner with the force
And strong encounter of my amorous tale.
After succeeding in this act of deception, he is quick to suggest another in making Benedick and Beatrice fall in love with each other. In the same way, we see his brother shares his talent for deception, at first convincing Claudio that Don Pedro is wooing Hero for himself, and secondly tricking both Claudio and Don Pedro into believing that Hero is unfaithful. The play thus confronts us with a very complex question: is deception always bad? The similiarities between these two characters and their different motives for carrying out acts of deception make this question very difficult to answer.