Is It Legal to Explore Abandoned Buildings?
In Canada, as far as I know, the rule about break and entering is using ANY force at all to gain entrance to a property. That would include anything other than just walking in to an open area. If you climb a fence, crawl under a fence, etc, that is trespassing and breaking and entering.
No trespassing signs can be just a red dot on a tree, or board, anything like that. Most any location, property, is owned by someone. It is extremely rare to find a place which is not owned by the government, an agency, an individual or some temporary setup while ownership is established legally. Never think an abandoned place is an unowned place.
Laws can be different between countries (Canada and the US) and counties, municipalities, etc. There are laws about what 'abandoned' means pertaining to buildings. It is simplest to assume no building is abandoned, likely it isn't unowned, just not in use. Those are very different.
So, yes, exploring abandoned buildings is trespassing.
If you explore don't look like someone out to cause trouble. Don't salvage or steal or vandalize. Don't bring tools which make you seem to be someone there to destroy or steal anything. Ordinarily, taking photographs is not something the police will be too concerned about. But, they will be aware of your safety, the stability of the building, and the owners right to not have trespassers, or squatters!
If you are caught, or questioned, about being somewhere be polite and respectful. Explain what you were doing and what you were not doing (vandalism or salvaging). Exploring is a risk, you accept the risky of being injured and the risk of being caught when you explore derelict or neglected buildings and places. Legally and ethically, you are in the wrong. Ethically because if you are injured it will be the property owner's insurance which will be used for whatever happens to you, or the building and its parts. Not really fair to the property owner, to be responsible for you. So, understand where you stand if you are stopped and asked to leave.
You do have the right to take photos from outside the property. From the public side, with a good camera (a lot of zoom) you can take photos. If you stand outside the property you are not trespassing. So, if you really want to avoid trespassing, you can. But, you won't see as much as you could see if you get closer, of course.
Do you need to scale a fence to get in? You're trespassing. Is there some variation of a "No Trespassing" sign on the premises? You're trespassing. Do you need to break a padlock? You're trespassing. And breaking and entering.
In the absence of such obvious signs, however, some complications arise that can muddy the waters. For instance, just because a building looks abandoned doesn't mean the law sees it as such. From a legal standpoint, abandonment is determined by specific time periods of vacancy, by levels of upkeep and even by an owner's long-term intentions regarding the property.
Source - Is it legal to explore abandoned buildings? - HowStuffWorks