As a teenage lion, Scar's original name was Taka. Taka was angry at his father and jealous of Mufasa. He tried to trick Mufasa into going to the waterhole, guarded by a buffalo named Boma. Mufasa tried to reason with Boma to share the water. Boma came after Mufasa and Taka. Mufasa escaped safely, but Taka was injured by one of the largest buffalo in Boma's herd causing a slash across his eye. This healed into a scar thus the name "Scar".
There are diffrent stories about how Scar actually got his Scar, one is that his father Ahadi gave it to him, another is that a buffalo did it, here's a part from the book:
Scar, called Taka before receiving his scar, tricks Mufasa into looking like he started trouble with a water buffalo named Boma. Scar's plan backfires when Mufasa escapes to safety, but Taka isn't so lucky and gets scratched across the face by a member of Boma's herd. Taka asks to be called Scar from then onwards as a sign of his foolishness.