Does "law" mean the same thing in these two sentences?

Civilization presupposes respect for the law.

By law, one is not allowed to own a wallaby in New York City.
the same meaning