Mushrooms are generally not fruits and vegetables, but a kind of edible fungi. When you say unsafe, you should mean that toxic elements may be applied, such as using industrial raw materials as culture medium to reduce costs, such as using industrial lime to make the culture medium weakly alkaline (because the growth environment of mushrooms is generally weakly alkaline), or it may be that the cultivation equipment is not clean enough and it is easy to be polluted in the process.
Food can be soaked in 1% salt water for 30 minutes.