Top-seeded Djokovic lost four straight games and had to save a set point before beating Filip Krajinovic 7-6 (6), 6-3 in an all-Serbian match, and No. 2 Thiem nearly squandered a 5-1 lead in his 6-4, 7-5 win over Vitaliy Sachko of Ukraine.
It was Djokovic's first match since losing the French Open final to Rafael Nadal, and his first indoor tournament since the Davis Cup Finals in Madrid in November 2019.
"I hope I have many more gears above today's level. I tried to be positive about my performance, about the game,'' said Djokovic, who improved to 38-2 for the season.
"It's not the first time that I kind of start a bit slower in the beginning of a tournament and then every day I get kind of a step further in the right direction."
Djokovic had an early break for a 3-1 lead but lost the next four games against his regular hitting partner.
However, Krajinovic failed to close out the set as he scored just one point while serving at 5-4. He later missed a set point at 6-5 in the tiebreaker and netted a smash on the next point.
"I know that Filip knows my game very well,'' Djokovic said. "I trained well the last couple of days, but it is different playing a match. Nerves were kicking in, and I wasn't playing well in the first set. He was playing better, and I was a bit lucky as one or two points can really shift the momentum of the game.''
Djokovic also took a 3-1 lead in the second but this time saved a break point in the fifth game and wrapped up the win when Krajinovic hit a forehand long and dropped serve for a second time in the set.
Djokovic, who won the event in his last appearance here in 2007, meets Borna Coric in the second round.
Thiem faced similar struggles against 529th-ranked Sachko. The Ukrainian player made his ATP tour debut, replacing Kei Nishikori, who pulled out with a shoulder injury.
The defending champion quickly went 5-1 up but lost his next two service games before breaking Sachko again at 5-4.
Thiem lost a 4-1 lead in the second set but broke Sachko once again at 6-5 with a powerful backhand passing shot.
"I had problems getting into the match, lost my serve too many times. But in general I am happy, and the last couple of games had the right intensity,'' Thiem said.
It was the US Open champion's 10th straight win in his home country; he won Kitzbuehel and Vienna last year.
After health and safety measures were tightened in Austria last week, a total of 1,000 spectators were allowed in the 9,000-capacity Stadthalle arena.