For many decades, Section 162(f) of the tax code has prohibited deducting any fine or similar penalty paid to a government for the violation of any law. But the law is riddled with exceptions. Creative companies can often find ways to write off even the biggest fines.