NEW DELHI—After Walmart Inc. sealed a $16 billion deal last year to buy India’s biggest domestic e-commerce startup, it got some bad news. India was changing its e-commerce regulations.

Foreign-owned online retailers would need to modify their supply chains and stop deep discounting. Those rules didn’t apply to Indian companies.

India, the...