One of the main characters, Hajime Saitoh, was a real person. Saitoh was a swordsman for the Shinsen Gumi throughout the last days of the Bakufu (Shogunate) government and the fighting leading up to the Meiji Restoration. After the defeat of the Shogunate, he did obtain a job in a provincial police organization, where he spent his days before this death near the end of the century.
The television series is based on the manga of the same name but the plot eventually takes off in its own direction.
"Rurouni", translated as "wanderer", is not in fact a real Japanese word. It is a neologism by the original creator of the comic this series was derived from.
Another real-life personality in the show is Toshimichi Okubo. Okubo was one of the men who overthrew the Tokugawa Shogunate, and was one of the founding members of the new Meiji government.
The first two seasons follows the manga its based on fairly closely until the third season, at which point it goes in a completely different direction.