“Mad money” seems to be interchangeable with the phrase “pin money”, so Helen went to work researching.
Both phrases seemed somewhat sexist in origin, referring to the allowance that a husband gave his wife for stereotypical “feminine” expenses such as pins to secure their clothing.
The phrase “pin money” is said to have originated in the Middle Ages in England 
To prevent the upper class from hoarding these “luxury” items, England 
When the Industrial Revolution introduced a plethora of available pins, the price dropped and “pin money” became then known as a wife’s pocket money regardless of its intended use, later to imply any type of incidental expenses.
The first documented printed use of the phrase “pin money” was credited in 1697 to British architect Sir John Vanbrugh (known for designing famous Blenheim  Palace 
“Mad money”, the American version of this British idiom seems to have been coined much later.
“Mad money”, the American version of this British idiom seems to have been coined much later.
 In a 1922 article on Bryn Mawr slang, Howard J. Savage defined ”mad money” as “money a girl carries in case she has a row with her escort and wishes to go home alone.'" Since it was almost unheard in those days  for a young lady to not to have a gentleman escort her home, perhaps the terms meant that she was mad, or angry at the young man for perhaps an indecent advance, and used the money to get herself home alone. 
In 1946, C.M. Woodard re-defined “mad money” to include “…Also money used by a girl or woman for small purchases.” 
Webster’s 3rd Dictionary (1961) was the first to record this term with both the meanings: “carfare carried by a girl on a date to provide a means of escaping her escort in the event of unwanted familiarities; broadly: a small sum carried by a woman for emergency use” and Random House Dictionary listed ‘mad money” as “a small sum of money carried by a woman on a date to enable her to reach home alone in case she and her escort quarrel and separate.” 
 
 
 
 

