Is it possible for a lens to act as a convergent lens in one medium and a divergent lens in another?

Yes. A lens makes use of the property that when light travels from a less dense medium (air) into a more dense medium (glass) it bends toward the surface normal. And when it travels from a more dense medium to a less dense medium it is bent away from the surface normal. So if the lens were placed in a more dense medium then itself the typical direction of light bending would be reversed. You should get a complete reversal of the roles played by a convex lens and a concave lens if you made a cavity inside a glass block in the shape of a lens. A concave glass lens in air does not give a real image but a concave cavity in a glass block should give a real image, in the block.