Question is whether China can block any merger deal between a U.S. company and another company even if they don't ship goods or sell services to China
China did not block the merger to which the question refers. That is, they did not actively say "no" to it. They simply did not issue a decision on a request for regulatory approval. Nor did that force the parties involved to kill the deal, but it did set the stage for a bilateral business decision by the parties not to move forward.
But yes, China can apply pressure in favor of or against all manner of business deals, between any parties, anywhere. How effective such pressure can be will depend on the parties and their overall business plans, but direct or indirect threats of fines, asset seizures, denial of permission to conduct business, criminal prosecution, or the like will be highly (de)motivating to some.
whether the U.S. government can do anything to allow a merger to take place even if the companies don't receive regulatory approval to do so.
Nothing prevented the merger in question from taking place. The parties decided to back out.
The U.S. government could conceivably have intervened in favor of the parties by diplomatic means and / or by applying its own economic pressure against China or Chinese companies. Perhaps that would have persuaded China to approve the deal. In principle, the U.S. could even have attempted to apply military force, but in reality that's altogether implausible.
China is sovereign. Washington has no power under law to make or override Beijing's decisions (nor vice versa).