Which country did the word pajamas originate?

It was originally a Persian word that meant 'leg garment'. The British adopted it and made it popular.