I have seen e-bikes at bargain prices are they legal?

Yes they may be legal but price is a good indication of quality and service. Check spare parts availability, lithium batteries, bike should have gears, maximum 200W or EN 15194 certification. Be very careful some sellers are new to this business and they are importing bikes with limited or no spare parts. Some also Import a container of bikes before they develop a marketing plan. Subsequently the stock is slow moving and has to be quit at cost or sold on e-bay. The seller then closes the doors and your bike becomes an orphan.