As shown in Once Upon a Time in Wonderland, it is possible to break the laws of magic through the use of a powerful spell. One spell allowed both Jafar and Amara to break the first two laws of magic (bringing back the dead, and forcing someone to fall in love), but whilst Jafar threatened to break the third law (changing the past), he never decided to. Back in the main series, Zelena was able to break the third law by using a Time Travel Spell to travel to change the past, but this was instead accidentally used by Emma and Hook.
Back to topic. In "An Apple Red as Blood", Jefferson uses his hat to open a portal to EF and retrieve the poisoned apple for Regina. However, the place and time that this portal opens at clearly breaks the third law as he opened a portal to the past, and technically changed it by removing the apple (which would likely have remained there to rot, or be taken away by the Evil Queen) and bringing it to the present.
It has commonly been stated that the laws cannot be broken, only to later be slightly changed by stating that an extremely powerful spell can break the laws. Jefferson's Hat (to me) does not seem to be on this level of power as it was not made to break the laws, merely travel between worlds, not through time. Thoughts?