The answer to this question can differ on a case by case basis. It also depends on when said extension was built. You should speak to a lawyer or title company about this. You can then find out what you need to do based on the exact property you are referring to.
Mitchell S. Feldman
Associate Broker/ Director of Sales
Madison Estates & Properties, Inc.
Office: (718) 645-1665/ Cell: (917) 805-0783
To my knowledge, the title can not show if it is legal or not. You should check with the department of buildings, they would be able to tell you if it is or not. Here is the website:
Best of luck