On Punk Hazard Law formed an alliance with Luffy to take down Kaido. Despite their opposing views on what an alliance is meant to be, their relationship is ultimately positive. Law puts up with Luffy’s antics and begrudgingly respects him. Luffy, himself, is very fond of Law and is overtly casual with him despite his serious demeanor.
Law does seem to have some doubts about Luffy’s reliability and carefree attitude. Though Law indicated that he wished to ‘use’ Luffy when forming the alliance due to the Straw Hats’ great unpredictability and ambition, he instead feels like the one being used. During the Wano Country Arc, the one thing that deeply concerns Law is Luffy’s tendency to get into trouble and complicate his plans.
Anyway Law has a deep trust in Luffy, which is uncharacteristic of the strictly professional relationship that he originally intended to establish with the crew.
People often like to compare Luffy and Law to Roger and Whitebeard, but there is actually a much closer and interesting parallel, which is Garp and Sengoku.
- Garp is the grandfather of Luffy and Sengoku is the grandfather figure of Law by connection (Sengoku was the father figure of Rosinante, who was the father figure of Law).
- They share the same dynamics in personality and humor. Luffy/Garp are carefree and reckless, while Law/Sengoku are serious and tactical.
- Luffy and Law are allies rather than rivals similar to how Garp and Sengoku were as partners.
- Koby also parallels Kuzan in the way Koby admires Luffy just like Kuzan admires Garp.
If you think about it, Luffy and Law are pretty much what Garp and Sengoku would have been if they were pirates.