This should be avoided at any time.
When the battery has been in a washing machine, it is no longer fit to use. It is likely that the battery was short circuited and/or that it will start oxidizing quite fast, in which case leakage and additional short circuiting is possible.
Please dispose this Battery. It is always recommended to rewash the clothes.