There is no rule that you use "a" on the first mention and "the" on the second mention.
You use "the" when you have established a definite identity for the noun. You use "the" when there is a shared understanding between you and the listener that can answer the question "which?".
Now when you say "I went to the park" you mean that you know that your listener knows which park you are talking about. That is probably because you and your listener are in the same town and there is only one nearby local park.
But there are several bars you could visit, so you might say "I went to a bar" because you know that your listener doesn't know which bar.
Now suppose there are several parks in the city that you are visiting. If your listener doesn't know which park you mean then you would say "I went to a park".
Similarly, suppose you always go to the same bar on Friday evening, and your listener knows that. You might say "I went to the bar"
Now one way to establish the identity of a place is to mention it.
I went to a bar on Friday. The bar was clean.
By the time you reach the second sentence, your listener knows which bar - It is the bar you mentioned in the first sentence. But the reason for using "the" is not because it is mentioned a second time. It is because the listener knows which bar you are talking about.