Lawful means you abide by the cosmic energy of Law. It is not necessarily local human made laws, though if you have an option to do so, Lawful characters would prefer to work inside and alongside the locals if possible if they do not contradict the cosmic energy of Law.

Local laws made by humans can be fallible, according to the cosmic energy of Law. For example, if a local law states "If you manage to steal something and not get caught, then it's legally yours". This actually exists in the Elder Scrolls bosmeri culture, so it's not a random made up example. The local law encourages a society where people get good at stealing things so they don't get caught, but this is actually encouraging chaos, since everyone turning into a thief and property exchanging hands constantly is chaotic, and is in opposition to what the cosmic energy of Law encourages. So a Lawful character would oppose this local mortal-made law.

That said, in DnD and PF, the majority of local laws are written with the cosmic energy of Law as an informing factor. Most people who sit down to write laws are going to be Lawful themselves, thus their choice of profession, so they often align. A Lawful person wrote the local laws.

The DnD/PF alignment system is usually pretty straightforward and most of the misunderstandings are from fans over the years inserting their own opinions or intentionally trying to make things relative, but that's not the point. These people forget that Law and Good and Evil and such are actually cosmic forces that have their own planes and monsters made of that energy, and you can just consult these for how to align yourself.