Your argument is based on the assumption that there is no objective morality. If that were the case, then nothing would be right or wrong, and having laws certainly wouldn't make it so as there would be no moral compulsion to follow the law.
That's right. There is no moral compulsion to follow the law. However, there are punishments if you go against the law. The punishments will prevent some but not all people from committing a crime. The OP's question is vague. He didn't say "morally ok" but just "ok". For that, I interpret as "ok for the society". Laws affect every member of a society and is supposedly something the society agree on due to previous politicaly manuevers. Therefore I think it is appropriate to use it as a criteria to decide whether an action is "ok for the society".