In American usage, opportunity is regularly used with to followed by an infinitive:
... it was a fine day and a good opportunity to enjoy the salt air —John Cheever, The Wapshot Chronicle, 1957
He gave them every opportunity to escape —Saul Bellow, Herzog, 1964
... had hoped for an opportunity to start work on a novel —Current Biography, January 1966
Opportunity to seems to occur only infrequently in British English:
... offered new opportunities to these communities to enter an honourable and profitable profession — D. W. Brogan, The English People, 1943
American usage favors opportunity for followed by a noun phrase somewhat less frequently than it does opportunity to followed by an infinitive:
... offered unlimited opportunities for water transport —American Guide Series: Rhode Island, 1937
... opportunities for broad university reforms are endless —George W. Bonham, Change, March-April 1969
British usage of opportunity for with a noun phrase occurs only a little more often than does use with to:
... a present that can offer little except an opportunity for limited reparation —Times Literary Supp., June 1969
Opportunity for followed by a gerund is found less frequently in both American and British usage than the constructions already mentioned:
... gave him an opportunity for thinking and writing —Current Biography, July 1965
... the street boy has not the same opportunities for working off his adventurous animal spirits —George Sampson, English for the English, 1921
Opportunity of occurs in both American and British usage. In fact, opportunity of followed by a gerund appears from our evidence to be the most common of these constructions in British usage. Although it still occurs in American English now and then, it was more frequent thirty years ago and before:
He seldom loses an opportunity of dispraising the present, of showing his profound pessimism —The Journals of Arnold Bennett, ed. Frank Swinnerton, 1954
... have an opportunity of becoming acquainted only with his work as a teacher —Times Literary Supp., 12 Jan. 1967
... he delayed accepting the opportunity of returning to the Washington Post —Current Biography, May 1965
... affords the lay reader the opportunity of entering into intellectual intimacy with Judge Learned Hand —Felix Frankfurter, N.Y. Herald Tribune Book Rev., 18 May 1952
Opportunity of followed by a noun phrase is also found in both American and British English, but less often than the construction with the gerund:
... would give the priest moderator an opportunity of more frequent personal contact —Thomas F. Cribbin, Bulletin of the National Catholic Education Association, August 1949
"This," I said, "would give us an opportunity of long-needed talks...." —Sir Winston Churchill, Closing the Ring, 1951