This has been traced back to at least to the years around World War I. But here’s another theory. During World War II, military aircraft engines included a part called a “rocker arm” that had a roller attached to one end that opened and close intake and exhaust valves.
When it was seen to be working properly, mechanics said that the engine was “rocking and rolling.” When these same mechanics went drinking and dancing in the 40s, they were said to be able to “rock and roll” as fast as their aircraft engines.
And when they returned home after the war, they applied this same term to a new type of music that was on the rise. It’s an interesting theory that I’m sure comes into play somewhere.