Today, dinner almost universally refers to the evening meal. But it has had a long etymological history to get to that point.
Those with older relatives might have noticed them say “dinner” to refer to the midday meal—what we would usually call “lunch” today. It’s rather archaic today, but it used to be the dominant usage.
It comes to modern English from Old French disner (via Middle English dyner), which originally meant “breakfast”, but later meant “lunch”. Disner is evolved into modern French dîner, suggesting the same more recent history has taken place in that language as in English.
Disner comes, ultimately, from Latin *disiūnō, meaning “to break the fast”.
So, depending on when you are, “dinner”, and its etymological ancestors, could have meant breakfast, lunch, or dinner.
To me it’s more a class thing - dinner is the biggest meai, which for workers and students was provided by the canteen in the middle of the day, while intellectuals preferred to discuss over dinner at home in the evening. When I was younger, posh people had lunch(eon), while others had dinner, and at least in the north of england the after-work meal at around 6pm was called ‘tea’ - which for posher people meant cakes at 4pm. Another variant for the evening is supper - also from french souper. By the way, in french it’s dejeuner that literally translates as break the fast (the small variant petit-d being modern breakfast).
Cakes at 4 is high tea, tea is still around 6. Or so I’m told. On this side of the bond tea is only a drink.