That would be because the outlines themselves are not the same colors, just the blue/white and black/yellow sections. Here’s an image I quickly edited with the outlines and skin removed, so you can see just how much an effect they have on the image. Both dresses still look normal, but they no longer look like completely different colors when compared together this way.
(edit): And here’s the same image with the outer boxes removed, to show how much the lighting is affecting things, where one of the dresses just looks completely wrong to me now.
The black and yellow colors inside the boxes are actually the exact same color, and the same goes for the blue and white colors inside the boxes (which is what the seamless bars connecting them is there to demonstrate). But they look completely different, right? The picture is showing us two different ways the exact same colors can be interpreted differently depending on the context surrounding it.
If you go to my profile and look at my comment before this one, I posted two slightly edited versions of the image that better show how they’re the exact same color.
The way this connects to the original image of the dress, is that some people see a gold and white dress because they think the dress is in blue-tinted lighting, as though they were standing in shade. People who see an overexposed image with a bright yellow tint, on the other hand, will likely see a blue and black dress. I couldn’t tell you why it happens, but it’s the way our brains perceive the lighting that’s doing it.