Yes, certainly it is possible.
The focal length of a lens is given by the lens maker’s formula:
1/f=(n2/n1−1)(1/R1−1/R2)
Here, n2n1n2n1 is the refractive index of medium 2 (lens) with respect to medium 1 (the medium in which it is placed).
If the lens is placed in a medium optically rarer than itself, this value is greater than 1 and the focal length is positive (acts as a converging lens). If the lens is placed in a medium optically denser than its own medium, focal length becomes negative and it acts as a diverging lens.