You can get a great mix with headphones, but you need to be aware of the downfalls of headphones that will likely cause issues. Some issues are that you cannot easily set a consistent playback level (can't measure it), you cannot measure the frequency response of the specific pair of headphones, ear fatigue and general discomfort can occur quickly, and it can be difficult to get a mix that will translate well to devices that aren't headphones or earbuds. Monitors have the advantage in these areas.
Headphones do however have advantages over monitors. For one, it usually costs less to get a good pair. Secondly, you don't have to deal with setting them up in an appropriate location in whatever room you work in (issue for bedroom producers and engineers). You also don't have to worry about the affect that your room acoustics have on what you hear.
I personally use headphones for the majority of my work since they fit my current lifestyle (poor student working on a degree). I get around most of the issues by using at least one reference track in my projects. That allows me to hear how professionally mixed tracks sound on my headphones and at the level of output from my headphones. When I am able to purchase and use monitors, I'll still be using reference tracks to combat the negatives of monitors that I don't have complete control over fixing.