One definition of "chance" does mean "opportunity":
Last week I got the chance to meet my favorite movie star / Last week I got the opportunity to meet my favorite movie star.
He has a chance to win a medal in the next Olympics / He has an opportunity to win a medal in the next Olympics.
Both of these examples mean more or less the same thing; however because of the broader definition of chance there is a nuance of random possibility. A chance to win a medal implies luck is a factor, while an opportunity to win a medal just means, as you say, an occasion.
You can change the meaning by using the instead of a:
I had the chance / the opportunity to see dolphins when I last went to the beach. (I saw dolphins)
I had a chance / an opportunity to see dolphins when I last went to at the beach. (I could have seen dolphins, but didn't)
Of course "chance" has other definitions where you can't swap in "opportunity":
They say poker is a game of skill not chance.
Is there any chance you could buy some eggs while you are at the supermarket?
I had a chance meeting with my boss at the baseball game.