In any case it's not true, batteries can be used too (I believe the dynamo regulation was true some time ago, but not currently).
Hub dynamos are indeed more expensive (around 50€ as a starting price) but since bikes are the primary means of transportation for many people, I think they usually see this as an acceptable price for the convenience it brings (I know I do).
Also, quite a few bikes here are leased (for around 20€/month, including all maintenance) and those always have a hub dynamo I think.