Karlovic, 36, sent down 21 aces to take victory over the Swiss second seed after trailing a set and a break.
"I had a poor first set and was missing a lot with my volleys," said Karlovic.
"But I began improving in the second set and got a bit lucky when I converted my break points (in the sixth game at 3-3)," he said.
"After that, things started going my way."
Karlovic, who had lost five of six previous meetings with Wawrinka, next plays Serbia's Dusan Lajovic.
Later Wednesday, Spanish third seed Rafael Nadal was facing Bulgaria's Grigor Dimitrov.
Elsewhere in the opening round, fourth seed Kevin Anderson advanced over Croatian teenager Borna Coric 6-3, 6-2 while seventh seed and last weekend's Moscow champion Marin Cilic beat Basel native Marco Chiudinelli 6-3, 7-6 (7/3).
South Africa's Anderson sent down 29 winners, improving his record in the best season of his career to 45-22.
Jack Sock won an American battle with Denis Kudla 6-4, 6-2 and next faces countryman John Isner, the sixth seed.
Russia's Teimuraz Gabashvili stopped Argentina Leonardo Mayer 7-5, 4-6, 6-4.