My understanding is lawful is the spirit of the law and legal is the letter of the law. Is this correct? If so then if you have to break the letter of the law to fulfill the spirit of the law would that be a case of something being lawful and illegal?
Possible example, traffic violations. Speeding is always illegal but as far as I know judges and police give drivers a break if they are the only car on the road, or if everyone is driving their cars in a safe orderly manner matter despite driving ten miles the speed limit.