When I was in junior school, one of my teachers liked to gently tease us with this question, to which he thought there was no answer. But the question can be answered, if somewhat tongue-in-cheek.
First, paleologically. Just when the first egg was depends on how you define 'egg'. If you include the jellylike eggs of things like fish, then eggs date back comfortably to a time when all life was aquatic - that is, long before there was anything remotely resembling a chicken.
Second, evolutionarily. Maybe you don't like the above answer, and prefer to restrict the definition of an egg here to "something from which a chicken hatches". Never fail, we have a separate argument on offer. We can safely assume that the ancestor of the modern chicken also laid eggs, and over time it gradually evolved into our modern chickens. What this means is that no matter which animal we want to identify as the first 'modern chicken', it must have hatched from an egg... laid by an animal very much like a modern chicken.
The facts agree: the egg came first. Take that, teacher.