That rule isn’t universal though. “I go to the dentist every year” doesn’t imply that I particularly care about a specific dentist (or, case in point, about the specific dentist).
“This was a nice evening” is also difficult to characterize as not caring about which evening it is. As are books titled “An Introduction to XYZ”, where both the authors and the readers will probably care about the specific book.
"I go to the dentist every year" implies that you have a usual dentist or some sort of stable routine or plan vs "I go on a trip every year" which implies the journey is yet to be selected/defined from a multitude of options.
So I feel the rule isn't always taken literally, but the vs a is selected based on whether something is up for consideration/substitution rather than something that's well defined and specified.
Beyond that, there are cases where you absolutely are referring to a specific one, but use a/an.
"Our house has a pool" for example. There is a very specific pool being referred to, but it's sufficiently indirect that "the" would never be used here without radically changing sentence meaning.
Maybe it must be considered from the perspective of the speaker. He may have a particular dentist in mind when he says "the dentist" and maybe the listener not having privy to it may not be relevant.
And he may be saying "a" about the word "nice" instead of about the word "evening".
Note: This is just my opinion and an attempt at trying to make sense of it. Purely subjective take as I usually refrain from making purely opinion based arguments.
I'm going to the bank, the shop, the dentist, the pool - I have a regular one in mind and you may well also know which one I mean.
I'm going to a bank, a shop, a dentist - I've found a new one and I may well be about to describe it to you.
"A nice evening" - there have been ones before, there hopefully will be again, this was one of them.