Alibaba Group Holding Ltd. and BMW AG will team up to produce AI for cars in China, as the tech giant looks to monetize its emerging products and reach more customers.