Many people use fantasy as a way of coping and it isn't necessarily unhealthy. It is a defense mechanism. It becomes a problem, as any thought might, when it is an obstacle to "normal" life. This judgment of "normal" is usually determined by the individual. However, it may be determined by those around him as well.
I see that one of your tags is "schizophrenia." There are many different theories as to how schizophrenia begins. Neurotransmitter peculiarities seem to be the most likely. Fantasizing is not considered a cause in regards to schizophrenia or psychosis. Actually, delusions are not a way (nor do they begin as a way) of coping with reality. They are, for the people experiencing them, more troublesome and stressful than reality itself. In this way, they are the opposites of fantasy and coping.