The basic idea is correct but the details are a bit oversimplified (as you might expect for a comic essay become a TV show).
です did indeed originate in the red light districts of Edo (if you like), but we are not only talking about "geisha" here. First of all, there were men in that industry as well, and they also used です and ます; so did regular customers (if they wanted to be hip). The words even spread to regular townsfolk to a certain extent. But it is correct to say that です was considered lower-class and not the kinds of words samurai should use. This was about the 18th century.
Note that at this point です did not have the conjugations でした and so on, and nor was it considered "the polite version of だ". This happened in the 19th century and is really more of a Meiji thing than an Edo thing. This is also when we see です spreading out to more general usage, including in the upper class. The key driver is not "mistaken samurai", but rather the influence of women's language, including the language of geisha and other "flower-and-willow world" workers, on 山{やま}の手言葉{てことば} (the language of upper-class Edo→Tokyo society). This is a complex and interesting subject on which entire books have been written, but basically you see a lot of women with close ties to the world of geisha, including ex-geisha themselves coming into the households of the new upper class, as wives and also as "help" including child-minders. The makeup of this "upper class" was also itself in flux, as was all of Japanese society, really, once the Meiji period got going.
So it isn't so much that samurai got it wrong and spread the word around the country (although no doubt there were samurai who did get it wrong, and became the butt of jokes among people who knew better!). It's more that the limited set of people, particularly women, who originally used the word found themselves in key positions (wives, mothers, nurses, trendsetters) to influence the speech of the post-Restoration upper class. It was this upper class who made their speech the "standard," and the rest is history.
ます I am less sure about -- I know there are examples from the Muromachi period and in some of the Portuguese materials (so, appearing in the speech of or at least familiar to the samurai class), but I don't know if they can be directly connected with the current 丁寧語{ていねいご} "ます". (For example, there was an earlier です, deriving from でそうろう, but it is not the ancestor of the modern です.) However, if modern ます does derive from the language of geisha, I would expect that it became "standard" via the same processes rather than by samurai making mistakes.
ます です 芸者
, the first hit is detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1330330943, which may or may not be the best answer, but is related. There are some other hits.