Yes, subleasing is legal in Canada as long as your Residential Lease Agreement permits it. Each province and territory also has set requirements for subleasing, so check the relevant legislation.
For example, Ontario’s Residential Tenancy Act (RTA) only considers it a sublease arrangement when the sublandlord vacates the rental property. Say you have a friend renting the basement of your rental house. They may be considered a roommate or occupant under the RTA, not a subtenant.
Though verbal agreements are legally binding, they are hard to prove. Having an agreement in writing is best for both the sublandlord and subtenant to have a legally binding contract in place.