The initial €105 million signing picked up the problem as he tried to back-heel the ball near the corner flag midway through the first half of Saturday's away match, which was goalless at the time.
Dembele immediately raised his arm and then sat on the turf as he pointed to the back of his leg. He then walked off the pitch.
There was a brief spell where Barca had to play with 10 men as they readied a substitute, the France international ultimately replaced by Gerard Deulofeu four minutes after going off.
The ex-Borussia Dortmund winger had made his first Barca start against Juventus in the Champions League on Tuesday, having came on as a substitute at home to Espanyol last week, his first game in the club's colours.
He was the biggest signing of the summer at Camp Nou, helping to quell criticisms over the club's transfer policy which arose following the sale of Neymar to Paris Saint-Germain.
Barcelona confirmed during the second half that the 20-year-old had suffered a hamstring injury and that he will undergo medical tests in an effort to determine the full extent of the ailment.
Ernesto Valverde's side were trailing by the time they offered an update on Dembele, with Japan international Gaku Shibasaki having fired Getafe in front six minutes before half-time.