You should be able to guess with a success rate better than 50% by sampling the sky colour and checking the image for Earth-like features such as water reflections an buildings (which typically produce images with a lot of vertical edges).
However, I'd say it would be impossible to classify sunset images from Earth and Mars with 100% reliability (See Why the Sunset Looks the Same on Mars as it Does in Beijing, for example).