Yes, that can happen, but with overwhelmingly small probability. Say if you consider the probability that all the gas atoms in a box spontaneously are in one half of the box, the chance is approximately (1/2)^N, where N is on the order of Avogadro's number.