What I'll describe works with any homomorphic scheme, whether multiplicative (Elgamal) or additive (Paillier; maybe exponential Elgamal or BGN depending), but I'll describe it with multiplicative.
I assume what you mean is something like this: you have, say, five people. They all generate a random value $r_i$, and post the encryption of it: $c_i=\mathsf{Enc}(r_i)$. If you multiply all the $c_i$'s together, you get an encryption of all the $r_i$'s multiplied together, and assuming one party is honest (chooses a truly random $r_i$ and does not reveal it), the result is random. Note that if you submit $r_i = 0$, this will not be a valid ciphertext in Elgamal (so parties should also check that each $c_i$ is in $\mathbb{G}q$).
I am not clear on your question: is it, how can I tell if two people submit the same $r_i$?
If so, there is an expensive (quadratic) way of telling. Take two $c_i$ values to test, say $c_j$ and $c_k$. Divide (i.e., invert and multiply) them. This will give you: $c_d=\mathsf{Enc}(r_j/r_k)=\mathsf{Enc}(d)$. If they are the same, $d$ will be $1$ and $c_d=\mathsf{Enc}(1)$. If they are different, $d$ is not $1$ (and equal to their difference).
You could decrypt $c_d$ and see if it is $1$ or not, however if it isn't $1$, this will leak some information about $r_j$ and $r_k$: namely their difference. So the trick is to have your five people all generate another random value, $b_i$, and exponentiate $c_d$ by it: ${c_d}^{b_i}=\mathsf{Enc}(d^{b_i})$. If $d$ is one, exponentiating it by a random value will still result in $1$. If it is not $1$, exponentiating it by an honestly chosen random value will (overwhelmingly) result in a random value that is neither $1$ nor will leak any information about the original values. Have each of your five people do this independently and then have the holder of the decryption key decrypt the result (ideally the key would be distributed among the 5 people).
Three remarks:
This is expensive. For $n$ people and thus $n$ values of $r_i$, you have to do $n^2$ comparisons, and each comparison involves the $n$ people doing a modular exponentiation (plus the decryption cost).
This is assuming the parties are honest but curious (will follow the protocol but are happy to learn anything they can about the values). You can use some basic zero-knowledge proofs to enforce everyone behaves honestly (for example, they actually apply an exponent $b_i$ to the ciphertext instead of making a brand new ciphertext and claiming it is the result of their exponentiation).
It shouldn't matter if two people submit the same $r_i$ value. Maybe you are concerned with people submitting the same values if you repeat this protocol to generate a couple of values? If so, you can do the same tests between a person's submission in each round.
Edit: the method of exponential blinding I described works to test the equality of any two plaintexts (encrypted under the same public key). Each time the protocol is executed, you can take the result and run the test against each of the previous generated values. This requires less tests than comparing individual contributions to each other.