Things that are fixed with great speed, but as a result, it's probably not going to work very well.
This phrase looks to be a recent one, appearing somewhere between the early to mid 20th century. It alludes to things that are fixed with haste, but because the fix was done in a hurry, it tends to come at a price, making it 'dirty.' Basically, the problem was fixed, but it wasn't done particularly well.
Wikipedia says this expression is popular among programmers, which seems to be the case, though I'm speaking anecdotally. Nevertheless, the phrase looks to have only been used in conjunction with computers and programers since the 1970s, based on what I could find.
For example, there's a book from 1978 called Computer Methods in Operations Research, wherein it talks about lazy programmers and their quick fixes:
"The lazy programmer will require the user to provide data cards ordered in such a way as to cause the predecessor to a node to be read in prior to the node itself. This approach may have some merit for quick-and-dirty solution situations."
Earlier than that, however, the idiom is used in the Popular Mechanics Magazine, July 1944:
"Of course procedures at the modification center were not in accord with the customs and practices of engineering because operations began with nothing except layouts and sketches. It was a case of 'quick and dirty tooling' and rule-of-thumb engineering at the start."
* My dog chewed through an electric cord that powers my television, so my quick and dirty solution was to patch it up with some tape, which worked out quite well... for now.
Find more sayings with this handy list of phrases. It has their meanings and other interesting information!
Phrases and Idioms
knowyourphrase.com - Meanings and Origins of Phrases and Idioms
Note: The origins for most idioms are unclear. Often times, the origins you see listed are plausible theories to how an idiom came to be, but not necessarily so. The quotes you see that contain the phrase are the oldest that I could find, but it's very possible there are older recordings somewhere, so if you know of any, let me know!
Keep in mind, just because you see a saying in a newspaper from 1850 does not mean it originated in that year, or from that newspaper. In all likelihood, if a saying is already being used in a form of media like that, it's probably from an earlier time. The purpose of these old quotes is to show, with proof, how old some phrases go back in history.