Before going farther, there are some plastics that can be safely melted at home with good ventilation as long as you use the right procedure (warm it slowly and don't exceed the temperature needed to melt it), and some plastics that give off toxic fumes when they melt, so you should never try to melt those indoors. Do your research.
The question asks about the mold material. High-temperature silicone rubber will handle most kinds of melted plastic. You can also use materials like clay (fired) and plaster. So that part's easy.
Most common thermoplastics melt at temperatures a household oven can reach. So yes, you can melt almost any thermoplastic at home. That part is also easy.
The hard part is how to do the molding. As the other answers point out, you can't simply pour most kinds of melted plastic into a mold. Most thermoplastics don't become a thin liquid that will flow into nooks and crannies of a complex mold by gravity. They become like sticky putty. That's why they are generally forced into a mold under pressure.
But that isn't the end of the story. For some applications, you can still mold those plastics at home without special equipment, and there are a few plastics that do become a liquid that you can pour into a mold.
The plastics that become very viscous are commonly pressed into sheets or blocks that can be cut and machined to make stuff. People do it at home with no special equipment; there are lots of online links to that. But these plastics can also be molded into simple shapes, and even pressed into simple open molds. Molds with deep fine detail, or complex two-part molds, require equipment you aren't likely to have at home. But I've molded simple items out of HDPE.
The mold has to be strong enough to not distort under pressure. For simple shapes, you can make the mold out of wood (I've made things like brackets that way). To copy an item and capture detail, you can make a mold out of silicone rubber that is contained inside a wooden frame.
You scoop the melted plastic into the mold and slightly over-fill it. Then cover it with baking parchment and a board (and a board under the mold if the bottom isn't solid). Clamp the top board against the mold. The plastic can flow slowly, so tighten the clamps after a few minutes. If the board bottoms out against the mold, open it up and add a little more plastic. If it is a small mold and the plastic has cooled, remove the plastic, remelt it, and start over using more plastic. Repeat the clamping process. When the plastic is cool, remove the clamps and it's ready (you will probably need to trim off some flash).
Some plastics do melt into a pourable liquid that you can cast. Here are a few common ones.
Embossing powder. There's a whole craft industry built around the hobby of casting small items with this. The powders are proprietary, but a chemist who dabbles in stuff like this guessed that they are primarily acrylic powder and posted videos on making your own by precipitating it from acrylic floor polish. (Couldn't locate the original, but here's a summary).
The DIY powder works for embossing, but I've never tested it for melt and pour. The powder would be expensive though; the floor polish isn't cheap, and the acrylic is just a small portion of it. If the commercial embossing powder is mostly acrylic, it might be possible to break up acrylic plastic sheets from the hardware store and melt that (never tried it).
- Hot melt glue. It shrinks a little when it cools, but you can minimize that by coating the mold with a layer. Let it cool a little. While it is still very warm, add another layer. Repeat until the mold is full. It's probably softer than you tend to think of as plastic, but it's a handy material for quickly turning out items that don't need to stand up to abuse.
- PETE is the plastic usually used for water, soda, and juice bottles. It melts to a liquid phase that can be poured into molds. I've also used molds made by forming or embossing aluminum sheets or soda cans, then melting the plastic right in the mold. You'd never guess it from the soft bottles, but when you melt PETE into a molded block, it is very hard, extremely tough stuff.