Yes, nothing in RAW says you cannot, unless a DM rules otherwise.
Performing a ritual does not require constant concentration:
To perform a ritual that you have mastered, you spend a certain amount of time (specified in the ritual description) performing various actions appropriate to the ritual. The actions might include reading long passages out of the ritual book, scribing complex diagrams on the ground, burning special incense or sprinkling mystic reagents at appropriate times, or performing a long set of meticulous gestures. The specific activities required aren’t described in most ritual descriptions; they’re left to your imagination.
And interrupting a ritual is a voluntary act:
Interrupting a Ritual: At any time before a ritual is completed, you can stop it and suffer no ill effect. You don’t expend any components or pay any costs until a ritual is completed. You can’t resume a ritual that was interrupted, however, so you do lose the time you spent on an interrupted ritual.