Alan Tudyk mentioned the possibility of going back to the past in an interview in December 2016:
Do you think we’ll see K-2SO in any other installments?
I’m doing my best. (Laughs) Sure, why not? All these worlds are intertwined. It’s exciting to me what they’re doing with these stand-alones. You can criss-cross those timelines at any point. They’re creating them. They’re giving these backstories to characters and filling in blank spots like ours.
More recently, he's stated that he won't appear in the Han Solo spin-off film:
The Han Solo movie takes place before Star Wars and before Rogue One. So with these movies that are set before Rogue One, we could see K-2SO pop up, right?
I would like it. I don’t think it’s possible, because I think they’re done with the Han Solo one, aren’t they?
Oh, no. They just started filming.
They just started? That would be cool.
I’m not saying you’re in that one, I’m just saying maybe in the future…
No, I want to be in that one, man.