Nothing about having a roommate inherently prevents subleasing, but you might need their consent in some scenarios.
If your landlord is leasing out rooms individually, you probably do not need their consent. Even so, it is important to consider your roommate’s comfort level. In the spirit of being considerate, think about having your roommate approve the subtenant moving in. If they feel part of the decision, they may be more open to the sublease arrangement.
If you and your roommate are co-tenants, signed to the same Lease Agreement, you may need their consent. A Lease Assignment or Amendment might be easier in a scenario where there are a bunch of co-tenants, rather than trying to set up a sublease.
You and your roommate can also add a clause to your Roommate Agreement outlining a process for if one or both of you wants to sublet your rooms.