I've not seen anything that says simply scanning for open ports is illegal, doing vulnerability scans may be though.