You can do whatever you want if it is going to be used only by you. Restrictions appear when it comes to distributing the code you have modified. Nobody will claim (or even care) if you have changed something on your own installation.
I have answered a lot of related questions here: https://www.question2answer.org/qa/46924
BTW, in the answer I have linked, you can treat plugins or themes in the same way as you would treat your Q2A core changes.