Are there examples of chips where comparing 2 against zero would be slower than comparing 1 against zero?
First you have to ask yourself what while(1) or while(2) actually means.


  Now suppose a compiler is dumb enough and generates a comparison instruction and so the code compares 1 versus zero in the first loop and 2 versus zero in the second loop.


So your hypothetical compiler is then basically expanding those out to be while(1 != 0) and while(2 != 0), the results of which would be either a 1 (true), or a 0 (false).  Is this dumb compiler then going to be comparing those with 0 as well, and if so, what is it going to do with the results of that comparison?  I see an infinite recursion problem going on there.

Leaving that to one side, though, and we assume it only does the one comparison and takes the result of that comparison as a logical yes/no value, how would you expect the compiler to implement that as assembly language? Well, obviously that depends on the architecture.  If you have a comparison operator then obviously it should use that.  Something like, in pseudo-assembly:

_while:
    ld r0, 1
    ld r1, 0
    cmp r0, r1
    beq _while_finished // jump if the compare was equal
    // ... loop code in here
    bra _while
_while_finished:
    // ... continue with the code.


Replacing the 1 with a 2 there would leave it the exact same number of instructions.  

Few small microcontrollers have a cmp or similar, so the most common way is to subtract one value from another and test to see if the result is zero.  For instance:

_while:
    ld r0, 1
    ld r1, 0
    sub r0, r0, r1 // Subtract r1 from r0 and leave the result in r0
    beqz _while_finished // Branch if zero flag set by last math operation
    // ... loop code in here
    bra _while
_while_finished:
    // ... continue with the code.


Again, substituting the 1 with a 2 would leave the same number of instructions.  So you have to ask yourself now, with that code, which part could potentially take longer with a 2 than with a 1?  Only the sub instruction has the potential to do that, and then only if the chip design is incredibly poor.  Typically a sub or add instruction is performed as one single operation by the ALU, and the values involved have no bearing on the time taken.  Only if the ALU performs a sub a, b, c by first loading a with b and then decrementing it c times, would it have any possibility of the numbers involved having any bearing on the time taken - and I have never come across such a primitive way of doing it.  Unless of course the chip were designed by the same person that designed the compiler ;)

So the answer is:

In any normal system no, the operands to the comparison would have no bearing on the time taken to do the comparison.