German carmaker Volkswagen has admitted to rigging millions of diesel vehicles worldwide in a bid to thwart emissions tests in the US and elsewhere.