Have a mateur tank, at the very least a year old, preferably a little older and large er than 30 gallons, at least. Cucumbers are venomous and produce a very nifty and equally deadly toxin that, in a fish tank will most surley kill everything (depending on size of the worm and tank). They are very sensitve to improper water conditions (fast salinity shifts, nitrates, copper) and if they die or get picked on or sucked into the intake of your filter they will realease their digestive system and this will poison the tank.
Many need a deep live sand bed to be maintained as they pass the sand and digest the organic material in it. Others (sea apples) Have mouthes like feather dusters with branching filter feeding organs that catch their food. They are sensise and usually find a desierable spot and stay there. The black ones and any long ones that feed on the sand bed will crawl slowly and get into ll the crevaces.
If you dont have any fish that will hurt it, your intakes arent very powerfull or are protected, and you have a suitable set up they can be quite interesting and beneficial detrivores. But if you screw them up you can essentially nuke your tank.