If we want to take this seriously, just for fun, then we need to first consider what "put the last bag inside the first" means. Bags of holding are openings into extradimensional spaces, effectively portals. Theoretically, I don't think there's any problem with extradimensional spaces containing portals to each other in a looped manner. The problem comes with the physical act of placing one bag inside the last. In order to do so, you'd need to have a way to teleport into a known extradimensional space without using the opening. I don't think there's a way to do that in any edition of DnD or Pathfinder, but I could be wrong. If you can, however, then you could use exactly the same technique to retrieve any of the bags and therefore open the loop again.
I was thinking more like each bag half inside the next, so the top or opening is poking out the top of the next open until you loop them all around and then push them all into each other tighting up the ring until 'pop' they lose any physical existence
If we want to take this seriously, just for fun, then we need to first consider what "put the last bag inside the first" means. Bags of holding are openings into extradimensional spaces, effectively portals. Theoretically, I don't think there's any problem with extradimensional spaces containing portals to each other in a looped manner. The problem comes with the physical act of placing one bag inside the last. In order to do so, you'd need to have a way to teleport into a known extradimensional space without using the opening. I don't think there's a way to do that in any edition of DnD or Pathfinder, but I could be wrong. If you can, however, then you could use exactly the same technique to retrieve any of the bags and therefore open the loop again.
I was thinking more like each bag half inside the next, so the top or opening is poking out the top of the next open until you loop them all around and then push them all into each other tighting up the ring until 'pop' they lose any physical existence