Answer
The second law of thermodynamics tells us that heat won't *spontaneously* flow from cold regions to hot regions. A refrigerator doesn’t violate the second law of thermodynamics because the heat isn't flowing of its own accord: the refrigerator does work to move the heat.
A similar analogy would be noting that the laws of physics prohibit a book from spontaneously jumping up from the floor and landing on a table. However, if I pick a book up and place it on the table, I have not broken any laws of physics.