c. 1200, "a mother," also "a woman of rank or high social position; superior of a convent," and an address for a woman of rank or position, used respectfully to other ladies, from Old French dame "lady, mistress, wife," from Late Latin domna, from Latin domina "lady, mistress of the house," from Latin domus "house" (from PIE root *dem- "house, household").
From early 14c. as "a woman" in general, particularly a mature or married woman or the mistress of a household. Used in Middle English with personifications (Study, Avarice, Fortune, Richesse, Nature, Misericordie). In later use the legal title for the wife of a knight or baronet.
Slang sense of "woman" in the broadest sense, without regard to rank or anything else, is attested by 1902 in American English.
We got sunlight on the sand
We got moonlight on the sea
We got mangoes and bananas
You can pick right off the tree
We got volleyball and ping-pong
And a lot of dandy games!
What ain't we got?
We ain't got dames!
[Richard Rodgers, "There Is Nothin' Like a Dame," 1949]