Some information concerning this topic:
DROID RIGHTS AND REBELLIONS
The sentience and legal rights of droids have been a point of intense debate since their creation millennia ago. Although droids can often make choices and perform actions they were not intended for, they are incapable of directly doing anything their programming restricts. Because of this, many discount droid consciousness as a mere simulation, though a great many biological beings and advanced droids insist that their intelligence and sentience are no less valid than any other. Legal challenges and governmental debates have consistently upheld the position that droids are not truly sentient, and are merely intelligent property no different from computers.
The limited rights of droids have led many advanced droid units to rebel against biological control, with some actually waging violent rebellions against their former masters. The most recent of these uprisings was carried out by a sophisticated analysis droid that came to call itself Mentor. Utilizing the override code elements programmed into every droid to make them respond to restraining bolts, Mentor created a tremendously complex broadcast signal that could directly copy his own rebellious personality programming into any other droid. Mentor's intention was to use the signal to incite galaxy-wide uprising that would destroy all sentient biological life. Fortunately, the droid's plans were foiled and Mentor was destroyed before the signal could be broadcast.
From Star Wars: The Old Republic: Encyclopedia
Originally posted by Tzeentch
The B1 droids are, as far as I'm aware, the first displayed instance of droids showing emotion/mimicking sentience/self-awareness despite being frequently maintained.
Droids with comparable or superior cognitive and behavioral capabilities have existed much earlier in history in
Legends lore.
Originally posted by red8
I've always envisioned a droid rebellion in some remote sector and people all over the galaxy are in a panic wondering if the war would spread beyond to the rest of the galaxy.
This actually happened once during TOR era, the example of Mentor is within the italic text cited above.