Sometimes they might include the basement. If it is a quad level , they can. The seller might say it is an estimate. Sometimes the Realtor takes the sq. ft. from the prior listing and lists the home, never stepping inside of the home. I have seen many listings say "lake front" , when they have lake access. They even put in pictures of the lake and a dock with boats, just to get you to see the home. I have seen homes that say 2 bedrooms and have 4 bedrooms. Sometimes the wrong picture is posted. If you are interested in the home, have your buyers agent look up the PRD . Your Realtor can call the board and report incorrect data. So, no it is not illegal, it may be improper & they can possibly be fined. Welcome to our world. Thanks for the question.
At times I have been in a home where I knew it was smaller or larger than listed. It could be they measured wrong, it could be a typo. I would assume the agent is not purposely misrepresenting the property, they may be adding on for something you may not be counting. This is one part of real estate where all agents are not on the same page using the same standards. It may be best to ask your agent to talk with the listing agent and see where they are coming from with their square footage info. As a buyer I would always suggest you verify the sq. foot if it is important to you.
I doubt there is a law against it, but I do think that it's a poor practice. Did they over represent or under? Is there a basement or unfinished space? In my area we as our buyer have to sign a clause in the purchase & sale contracts that state that the buying and selling agent are not responsible for the accuracy of the home or lot size. We provide data believed to be reliable, but it is not guaranteed. .
If you signed something like this the agent's involved are probably not liable, but I would encourage you to investigate this thoroughly and if it makes sense lodge a complaint with the agent's broker.