1550s, "coarse fabric," of Scandinavian origin, cf. Norwegian dialectal rugga "coarse coverlet," from Old Norse rogg "shaggy tuft," from Proto-Germanic *rawwa-, perhaps related to rag (n.) and rough (adj.). Sense evolved to "coverlet, wrap" (1590s), then "mat for the floor" (1808). Meaning "toupee" is theater slang from 1940. Cut a rug "dance" is slang first attested 1942. To sweep (something) under the rug in the figurative sense is from 1954.
To dance, esp in jitterbug style (1930s+ Swing talk)