I duno if thats a good idea, what if the package has small cracks that absorb the solution?
Usually the cleaning bath you use for PCB is not gonna get corrosive materials into the parts even if they leak, so long you bake it out, maybe a bit of soap residue.
If I were to do this, I would dip them precisely while on a clip so they never get submerged.
Rinsing maybe, dipping I would say is risky business, especially for a opto that is designed to isolate HV.
I would do ultrasonic bath with lab soap, then follow up with small abrasives (like fiberglass or brass mini brush) for anything left behind, then clean again.. but not acid. You would be surprised how much oxidation a ultrasonic bath can get rid of with just soap.
I did a acid bath for rusty lead diodes I had once (like evaporust), and they all failed, at only 20V. Soaked em maybe 5 min, rinsed, and baked them at 80C for a long time.. but they failed