You can but you have to exauste the air from the dehumidifier out of the box and dont want the air coming out of it going at the plants.. and have your air window open to oull new air in. . An exausy system pulling air out of the box and the dehumidifier can do pretty much the samething humidity in vegetation is good
And your humidity metre shouldn't be on the soil. Of cours ut will read high since that the source of the evapiration. Out it halfway up in the tent if you can..
I would not recommend it. Generally it has to pull air though the machine to pull the moisture out of the air so having it in the box might reduce it's effectiveness