Taking precautions is one of the most important things when talking about bicycles. As electric bicycles are basically bicycles with motors, all the standard precautions are still important and you should definitely use them.
Click here for general guidelines about safety riding.
However, e-bikes are faster then regular bikes and they have better acceleration. Also, the twist and go e-bikes are able to move you forward only with the twist of the throttle and without the need to do any pedaling, this should be taken into consideration when considering safety.
This is one of the reasons why the law in the UN permits only pedelecs. I assume that the original aim was to make the e-bikes behave as close as possible to how you traditionally use your bicycle and not as close to how you use a scooter, for example.
Just be aware of the low quality pedelecs. The motor continues to work for a few seconds even after you stop pedaling in some of them. That means that you will keep on moving for a few seconds until full stop.
E-bikes share the same lanes with other bicyclists, they are allowed to move on sidewalks and basically do whatever conventional bicycles are allowed to do. This is another reason why the maximum speed and the acceleration should be restricted.
E-bikes are specified as a light electric vehicle and as such, their maximum speed is limited (usually to about 25 km/h / 20 mph). In my opinion, e-bikes should obey this law and we shouldn't praise people who ride illegal e-bikes which are much more powerful then what the law permit. In such scenario, more accidents will happen, more people will have second thoughts about using e-bikes, and it can also cause regulatory backlash by setting more restricting laws, etc.
A different aspect of safety is how to guard your precious e-bike from theft. Click here to read more about it.
On the other hand, electric bicycles also offer some advantages when it comes to safety.
Most of the cities around the world are not so bicycle friendly, to say the least. Many cyclists drive on roads along with the traffic because the bikes lanes are not fully deployed across the city.
In such cases, e-bikes can be useful for keeping up with the traffic. The better acceleration will help you get out of traffic lights faster and the possibility to get away from dangerous situation on the road quicker. Also, it is possible to maintain a decent speed uphills.
Finally, in most urban places, the e-bike can quite easily maintain the same or even higher average speed then other motor vehicles.
In a case of collision, gas leakage from the fuel tank can lead to fire. Electric bikes are not prone to such problem because there isn't any liquid fuel involved.
Modern batteries are very safe. They are a whole lot safer to hand then gasoline. With good treatment, which basically means that you don't try to explode the battery on purpose by putting it under fire, or anything similar for that matter, the changes of a battery explosion are close to none.