Its simple. There was once an almost-chicken laying almost-chicken eggs.
Then a mutation occurred, an almost-chicken lay an egg with a mutated fertilized cell inside, it had a chicken inside.
Now why do you call a chicken egg an chicken egg? Because it is layed by a chicken or because it gives birth to a chicken?
If its the first then we call this egg still almost-chicken egg. But after a while the egg cracks open and a baby chicken emerges. So there we have it, chicken first, egg second. This chicken will go on to lay chicken eggs giving birth to little chickens.
Or for the other definition, we call this a chicken egg. So there we have it, a chicken first, then the chicken itself.
Of course because of the evolutionary advantage the chicken had over the almost-chicken, the almost chicken died out.