Exxon Mobil Corp. is running a pilot program using excess natural gas that would otherwise be burned off from North Dakota oil wells to power cryptocurrency-mining operations and is considering doing the same at other sites around the globe, according to people familiar with the matter.