In the 4th Pokemon movie, Sam goes forward in time along with Celebi and then battles alongside Ash and Pikachu. After the battle, Celebi returns him to his timeline. At the end of the movie, it evens shows Oak with a picture of Pikachu drawn in the notebook, kind of confirming that Oak and Sam were the same person.
For the director's comments on the English DVD involving the voice talent, they talk about watching the original ending and being completely confused on whether it meant that Oak and Sammy were the same person or not. They note that the original is a fairly typical way for a Japanese movie to solve a similar mystery in the storyline. Once they confirmed that Oak and Sam were indeed the same person, they created the new ending to clearly show that they were the same for the English-speaking audiences.
here is the end according to bulbapedia: "Oak notices Ash's disheartened face and asks him what exactly is bringing him down, as he hasn't said a word since they began talking. Ash replies that it's because he made a really good friend, but now it seems they'll never see each other again. Professor Oak responds that true friendships can withstand the test of time and he's absolutely sure that he'll see Sam again and that even though they're separated, they'll be friends forever. Ash feels better from Oak's kind words and promises to tell him the full story when he returns to Pallet Town, and Oak remarks that he's looking forward to it.
After hanging up, Misty notices something: How could Professor Oak have known that the boy they met was named Sam if none of them mentioned this?"sorry if its too long
When Oak gave Pikachu to ash. I don't think professor Oak was out of Pokemon, as he said:
"you are late. I am only left with one Pokemon which is very difficult to train"
Professor Oak has a lot of trainer's Pokemon's so they breed together and usually give birth to new Pokemon, which are then given to trainers.
Professor Oak is also a Pokemon researcher, but how did this help him discover Ash's Pikachu?
Maybe there is something unique about ash's Pikachu, and the professor got it after some research when he traveled back into the past.
So I am left with the simple question:
How did professor Oak know this particular Pikachu belongs to Ash as he saw in the future after he returned to the past then he gave the same Pikachu to the ash to start his Pokemon Journey. Maybe sam and ash will meet again as oak said at the end of the movie in another time travel event in the coming movies or episodes and this mystery can be solved.
Sources I used