While a pawn cannot capture en passant twice under the modern law of chess, it has not always been that way. We can play fast and loose with 19th-century rulebooks, as chess was not as standardized then. This is a thought experiment regarding the old rules of chess, all for fun.
As aforementioned, the rules weren't so cut and dry in the 19th century. Many joke problems were and have been made to exploit ambiguities in official rulebooks. The most famous is the loophole that allowed promotion into any of the opponent's pieces. However, the hypothetical legality promoting into an enemy pawn, on their first rank, was and is vague.
Furthermore, there is the question of how it would move.
But we can take liberties with our imagination and assume it moves like normal, including being allowed a double-step on it's first rank. For example, Lichess's chess variant Horde Chess logicallly allows this movement. If you count the transformed pawns as the "same" unit after the wrong promotion, capturing en passant twice is possible.
This takes two stages. First, White plays en passant and then advances to the 7th rank
[FEN "4k3/6p1/8/7P/8/8/5P2/4K3 b - - 0 1"]
1... g5 2. hxg6 null 3. g7
Now we pretend it promotes into an enemy pawn. Next, it advances forward to preform an en passant once more.
[FEN "4k1p1/8/8/8/8/8/5P2/4K3 b - - 0 1"]
1... g7 2. null g6 3. null g5 4. null g4 5. f4 gxf3
Thus, the "same" pawn has captured en passant twice!