Stolarz finished with 39 saves to improve to 6-1 against the Sharks in his career.
Karlsson had three goals and an assist for San Jose. Timo Meier added two goals.
Kahkonen stopped 39 shots.
Henrique opened the scoring 5:16 into the first period with his first goal of the year. Karlsson answered with two goals in 23 seconds, the seventh-fastest mark by a single player in Sharks history.
Vatrano tied it later in the first and Henrique put Anaheim back ahead with 15 seconds left in the period. Meier responded with a power play goal early in the second to tie the game at 3.
Strome gave the Ducks the lead later in the period, but Meier was credited with the tying goal just 21 seconds later when Anaheim’s Jakob Silfverberg accidentally shot the puck into his own net.
Comtois scored the go-ahead goal 11:31 into the third period, but Karlsson tied it with 2:12 left and the goalie pulled for an extra skater.
Karlsson’s hat trick was the first by a defenseman in Sharks history. He leads NHL defensemen with nine goals and 15 points. ... San Jose fell to 1-6 at home. ... Sharks coach David Quinn remained at 99 career victories. ... Ducks C Sam Carrick, recovering from hip surgery in May, was assigned to the San Diego Gulls of the AHL on a long-term injury conditioning loan.
Ducks: At Vancouver on Thursday night.
Sharks: Host Florida on Thursday night.
More AP NHL coverage: https://apnews.com/hub/NHL and https://twitter.com/AP_Sports
Ben Ross, The Associated Press