Yes that is my understanding of their history. Peasants who were being hassled by the Samurai and so developed these skills for defense. Later they moved on to doing jobs for hire.
You see, "samurai" was just a word for the gentrified upper class at the time. It wasn't until later, after unification that a caste system came into existence and "samurai" became associated with special clothing, top knots, and the right to wear (but not use) swords.
[Source: I was a Japanese language & history major at one time, and studied a number of years in the Bujinkan.]
EDIT: Okay, partial myth. Peasants who armed themselves fought for hire does describe the humble origins of some schools. It was the "peasants hustled by the samurai" part I was responding to as a myth.