Well, as we all know Shanks has a scar on his left eye which is given to him by Marshall D. Teach aka Blackbeard; the scar was absent on Shanks when he was part of Roger crew.
When Shanks visited Luffy at Foosha Village he had scar. So he received the scar from Teach during the period between Roger’s execution and the visit to the Foosha Village.
Here’s my theory. I’m going to start with the devil fruit which Shanks had (Gomu Gomu no Mi) and the devil fruit which Teach wanted (Yami Yami no Mi). Both the devil fruits seem to look similar for color and design. So it’s safe to assume that one can get confused on recognizing them. And if you are as desperate as Teach well you will.
Now, when Shanks entered Whitebeard’s ship Moby Dick, the reactions from various crew members were like they were meeting Shanks as Yonko for the 1st time, those who fainted on his arrival. Even Shanks’ conversation with Marco “so, you are 1st Division Commander Phoenix Marco” states that Shanks and Whitebeard never clashed as “Yonkos”.
So how and when did Teach gave the scar to Shanks??
I think that Shanks had found a devil fruit Gomu Gomu no Mi from a certain pirate crew somewhere in the Grand Line.
And Teach was already after Gomu Gomu no Mi mistaking it for Yami Yami no Mi, which he has seen in the book of devil fruits. So when Teach arrived, he found out that the fruit was already stolen by Shanks. So he planned to get the devil fruit from Shanks and we know how evil planner Teach is.
*Theory by blaze