Chemical composition and origin of nebulae around luminous blue variables