An illegal apartment is illegal for a reason. The city building codes are not arbitrary laws. There are many reasons why a basement (even more so a cellar) is dangerous to live in. Here is one huge reason: carbon monoxide poisoning.
many locales do not have the heavy handed rules NYC does, which effectively have taken an enormous amount of housing off the market for dubious reasons. the apartments on "Income Property" are often more than 50% underground, yet are thoroughly inspected by the (usually Toronto) authorities. they put in a vent system. CM detectors, etc. if that is necessary