Can I use hot glue as resin by melting them in a pan
It won't work.

You can melt hot glue in a pan, but it tends to turn yellow and eventually brown if it gets too hot. whether the mold survives the pouring depends on the material.

The real problem is that hot glue shrinks quite a lot while cooling down. The mold surface is cooler than the hot glue, so it sets at the outside first, while the center stays liquid for longer. As the center cools down and shrinks, it pulls all surface areas towards the center, warbing the object and possibly damaging the mold.

I've done this experience with a very small object: a papercut of a treasure chest, no more than 2 x 1 x 1 cm. I wanted to add weight to the object and filled the whole thing with hot glue. Once it was cool, the side walls were notably pulled in and there was a big (relatively speaking) hole at the top of the hot glue, where the top surface was pulled towards the center.