Both have different meanings. In some cases, they may mean the same. Here are the meanings of the two words.
fan·ta·sy
noun
1.
imagination, especially when extravagant and unrestrained.
2.
the forming of mental images, especially wondrous or strange fancies; imaginative conceptualizing.
3.
a mental image, especially when unreal or fantastic; vision: a nightmare fantasy.
4.
Psychology . an imagined or conjured up sequence fulfilling a psychological need; daydream.
5.
a hallucination.
illusion
noun
1.
something that deceives by producing a false or misleading impression of reality.
2.
the state or condition of being deceived; misapprehension.
3.
an instance of being deceived.
4.
Psychology . a perception, as of visual stimuli (optical illusion), that represents what is perceived in a way different from the way it is in reality.
5.
a very thin, delicate tulle of silk or nylon having a cobwebbed appearance, for trimmings, veilings, and the like.