There isn't a situation where an endless battle that it is impossible to escape from can occur, but there are situations where battles that could potentially continue forever can happen. There will always be one player in control of the battle though; they can choose to end the battle if they want.
>Some of you may be aware of a strategy going around that can force battles to continue indefinitely. This involves using Leppa Berry with Heal Pulse, Recycle, a healing move (such as Slack Off or Soft-Boiled) and Block/Mean Look/Spider Web. Fortunately only Slowpoke, Slowbro, Slowking, Blissey and Smeargle are legally able to use this combination (Ralts, Kirlia, Gardevoir and Gallade as well if you count Wish). To use the strategy, one of these will switch into a defensive Pokemon, or one unable to 2HKO them, use Block and then PP stall the opponent with recovery and Leppa Berry + Recycle. Once the opponent begins to Struggle, the user can simply continue to Heal Pulse, with Leppa Berry + Recycle, until the opponent forfeits. An example can be seen here. - Smogon
A real, legit inescapable endless battle like the Wobbuffet one in Gen 3 isn't possible though.