Earlier quoted context omitted.
I think it's a bit more like going on to a shop and trying to open all the doors, cupboards and drawers to see which ones are locked ;)
That's a bad analogy. It wrong because you can see what doors, cupboards and drawers are available for the public. Doors that are in-reach but that shouldn't be used by the public have signs like "restricted access" or "employees only". You can't do that with the internet. You can't see that a port is not available to you until you try it. If you want to continue using that analogy, then you have to consider that eve…
But you can see what ports/doors are available. TCP doors are defined in the RFC and they are numbered 0-65535. Those are the ones available.
Port scanning still is analogous to trying all these doors and see which one are open.
Just because it is a lot of doors to choose from doesn't make it very different. That's why guests ask a host where the bathroom is.
When you visit a website, it's not very cool for that site to check which of all your TCP ports are open. It's none of their business.