According to the Oxford English Dictionary, the earliest use of the word ‘loo’ to refer to a lavatory (rather than a card game) is in James Joyce’s Ulysses in 1922, viz.:

'O yes, mon loup. How much cost? Waterloo. Water closet'.

The 'loo/Waterloo' citation appears a tad tenuous to me, yet the OED further cites A.S.C. Ross’ 1974 examination which favours a derivation from Waterloo, “in some manner which cannot be demonstrated”, and it is said that many cisterns were prominently branded with the trade name ‘Waterloo’ in the early 20th century. *

However, the etymology of ‘loo’ remains unproven and alternative theories abound.

These include corruptions of the French ‘lieu’ (as above); ‘bordalou’ (an 18th century ladies’ portable commode); and “Regardez l’eau!” – Anglicized as “Gardy loo!” - a warning cry meaning “Look out, water!” formerly used when flinging the contents of one’s chamber pot out of an upstairs window, prior to the timely introduction of modern plumbing. However plausible these theories, both latter terms were long obsolete before the 1920s, making a direct link impossible to demonstrate.

There is also the somewhat fanciful suggestion that the word refers to Lady (Louisa) Lichfield (or Anson); this picturesque theory has it that, in 1867 whilst visiting friends at a house party, a fellow guest removed her name card from her bedroom door and placed it on the lavatory door as an amusing practical joke – resulting in other guests jocularly talking of “going to the Lady Louisa” and thereafter - so the theory goes - gaining popular currency in its shortened form.