Coverage depends on your city
Sometimes, yes. In certain California cities with rent-control or eviction-protection ordinances, those protections can extend to unpermitted units — meaning a landlord cannot necessarily avoid the rules just because the unit was never legally permitted.
The idea behind covering illegal units is that a landlord should not be able to escape tenant protections by having rented an unlawful unit. Whether local rent-control or "just cause" eviction rules reach unpermitted units depends on the specific city ordinance and the facts.
Statewide, California also has rent-increase and just-cause protections that apply to many rentals, though there are exemptions. How these interact with an illegal unit can be complex and fact-specific.
Because coverage depends on your location and the details, it is worth checking rather than assuming an illegal unit has no protection. If a landlord is claiming that rent-control or eviction protections do not apply because your unit is unpermitted, that may not be correct. A free, confidential review can help you understand which protections may apply to your unit.
This is general information about California tenant rights, not legal advice. Every situation is different.