The ambiguously colored dress making its way around social media poses two questions: First, how can a blue and black dress ever look white and gold? Second, how can two people see different colors in the same image? 
 For the first question: It is very easy (especially in photographs) to change the perceived color of an object by changing the illumination. This is because the color of the light entering your eye from an object mixes up the color of the illumination and the color of the object.  Is the blue light reaching your eye a white dress under a blue light or a blue dress under a white light?  Your brain has lots of tricks for “unmixing”, so such illusions rarely occur in real life.  But much real-world information is lost in photographs, and this can sometimes cause illusions, as in this impressive example from Bart Anderson.   In the viral image, the dress is seen in shadow, and shadows are very often bluish. (My daughter once asked me why the sidewalk under a shadow turned blue.)  In such bluish illumination, an object that reflects blue light well (the blue dress) will send much more light to your eye than an object that reflects blue light poorly. One way the brain “unmixes” object and illuminant is to say that the object reflecting the most light is white. Since the blue stripes reflect the most light, they look white. 
The second question is more difficult to answer. Why does one person see blue and one person see white?  Small differences in color appearance are not surprising: we have all likely argued at one time or another about whether a shirt or a sock is green or blue. It is the size of the effect that is interesting.  Without doing experiments, it is impossible to say for certain why people see these so differently, but here are some ideas.
One set of factors has to do with biological differences between individuals. First, people have different numbers of the photoreceptors that detect short wavelength light. Second, the location of these also varies within the eye, so if you at look at something directly it can appear a different color than if you look at it out of the corner of your eye.  Third, as people age, their eyes change as well: older people perceive less of the blue light in images than younger people do.
Another set of factors is related to viewing conditions.  The light that reaches your eye from an emissive display (like a computer monitor, tablet, or phone) depends a great deal on your eye’s position relative to that screen.  Try angling your screen forward and backward. Does this affect your perception?  Because two people might have different heights or be at different angles with respect to the screen, their eyes may be processing two different images even though they are looking at the same screen.  Similarly, when the brain “unmixes” the object and the illumination, individuals may focus on different parts of the image.  These different pieces of the dress (unmodified) illustrate that such focus could make a difference.
Finally, when the brain is faced with an image with ambiguous or contradictory cues (such as in the duck-rabbit illusion, face-vase illusion, or Necker cube) it will sometimes alternate between equally likely interpretations of the image.  In this case, the brain is asking: Is this a blue dress under white light or a white dress under blue light?  In this photograph, the cues to object color are uncertain enough that the brain can arrive at two different conclusions. 
Importantly, the principles at work in this illusion are the same principles at work in everyday color vision.  Our brains must “unmix” light to perceive the color of every single object we encounter: is it a blue dress under a white light or a white dress under a blue light? A yellow banana under a green light or a green banana under a yellow light? The truly remarkable thing is that our brains do this so well and so consistently that we rarely flood social media with perceptual disagreements. #ThisIsYourBrainOnColor