Elon Musk's endorsement of Germany's far-right AfD party ahead of the snap elections has sparked controversy, with government officials accusing him of foreign interference.