Yes, there are different types of filling. The old standby, mercury-silver amalgam, has been used for over 150 years to repair billions of teeth, but it has always been unattractive, and it has always been dogged by questions about the hazard of mercury exposure it presents.
The most common type of filling today is "composite," a combination material made of microscopic glass particles bound together by plastic resin. Composites have been used for over 40 years now, and have been subject to vigorous research and development the whole time. They are now recognized to be at least as good, and in many ways better, than amalgam at fixing teeth. Modern composite fillings are durable and long lasting, and look great.
How safe is the plastic in composite dental fillings? Even though many of the brands of composite have resin components that have caused concern, such as bisphenol-A (BPA), research has shown that they do not break down and release these compounds into the body under normal conditions of body temperature.
Porcelain or ceramic fillings are also used sometimes, though it's not clear what advantage they give over composites. When the tooth is damaged too extensively for a filling, ceramics are best used for onlays or crowns.
There are other materials – resin-modified glass ionomers, for example – that can be used for special purposes.