Legal fees related to seeking a refund of individual income taxes normally would be deductible as a miscellaneous itemized deduction subject to the 2%-of-adjusted-gross-income floor. However, this deduction is suspended for 2018 through 2025. Win or lose, legal fees related to business taxes (but not personal taxes on business income) may be a deductible business expense.
Taking an offsetting investment position to reduce the risk of loss in a similar investment.