In chapter 1, 10 years before the event of One Piece. 7 years old Luffy wanted Shanks to take him on his adventure but Shanks refused. Tired of being taken lightly, Luffy stood on Shanks' ship's figurehead with a dagger in his hand and cried out that he will show them how tough he is. He stabbed the bottem of his right eye, thinking foolishly that it would get Shanks to take him seriously but fails once again(Shanks was mad at him for that).
In the anime, it was skipped by Toei in fear that Japanese children will do the same thing so they left it a mystery. We never saw Luffy's scar during the anime flashback, even while Higuma is messing around with him. The anime flashback ended and kid Luffy still don't have the scar.
We never saw Luffy at age 17 departed from his village in the anime, we never saw him beat the sea king, we never saw him discuss about his journey and how many crew he needs, we never saw him get suck in the whirlpool. That tells me Toei skipped all of that just to keep the origin of Luffy's scar a secret.