The only country with which China has a mutual defense treaty is North Korea. So that would be their strongest ally in legal terms, although as with all asymmetric relationships between a great power and a smaller country, it mostly goes in one direction.
China has also [re]declared it has a "no limits" friendship with Russia, just before the latter invaded Ukraine, although that insofar hasn't translated in much military aid from China to Russia. (According to Western sources, Russia has recently bought drones from Iran rather than from China.) But there are other signs of this partnership being effective in the military sphere, including several joint naval maneuvers (which more recently have included Iran as well). (The joint drills also involving Iran have been low-key however, in terms of number of ships & location, compared to the bilateral China-Russia ones, typically carried out around Japan.)
The Shanghai Cooperation Organisation would be another (formal) level/layer, but one has to take this one with a larger grain of salt because it includes India as well, but India has unresolved border conflicts with China including border skirmishes (albeit down melee weapons in recent times). The other members are mostly from Russia's CSTO: Kazakhstan, Kyrgyzstan, Russia
and Tajikistan. Only Uzbekistan and Pakistan are in SCO but not in CSTO.
Also on the level of probably interesting, UNGA voting patterns of some of these countries tracks China's close enough. According to that analysis, North Korea had the highest correlation, followed by Cambodia and Pakistan, although there other more surprising results thereafter, perhaps, including Brunei.

This chart uses older data compared to the analysis at the link, up to 2013 rather than 2017, so Cambodia ranks lower in this chart. According to a 2021 analysis, Cambodia has been recently moved closer in China's orbit, which kinda matches/explains that. Other sources also describe Cambodia as China's closest ally within ASEAN. A Chinese envoy has recently described their relationship with Cambodia as "iron-clad partnership."
(The feeling appears to be mutual, with
Cambodia's PM declaring themselves to be “China’s most trustworthy friend”.
There's also a "China Index" project according to which Cambodia ranks first as the most China-influenced country, but the rest of list can be (quite) a bit more controversial, as it's followed by Singapore, Thailand, Peru, Kyrgyzstan, Philippines, Tajikistan, Malaysia, Taiwan, Australia, Kazakhstan, South Korea, Indonesia, Germany and the US, as the top 15. (North Korea, Pakistan, or Russia were not evaluated. [That was when I initially wrote this answer. I see that project has now evaluated Pakistan, and it ranks first.]))
There's a 2016 paper that lists the somewhat large amount of terminology that China uses to describe various partnerships. As one might guess Russia and Pakistan have special terms (but even Germany and the UK have one unique), but beyond that it's a bit hard to summarize. Newsweek has attempted to rank the terminological varieties in somewhat fewer bins, resulting in this map:

There are some differences compared to more detailed paper, e.g. India actually gets a unique term in the former.
sfxedit said in a comment that Russia and China do have mutual defense clause in their Friendship treaty. Well, it's not quite as explicit as the one in the China-DPRK treaty.
Compare:
The Chinese side supports the Russian side in its policies on the issue of defending the national unity and territorial integrity of the Russian Federation.
The Russian side supports the Chinese side in its policies on the issue of defending the national unity and territorial integrity of the People's Republic of China.
with China-DPRK:
In the event of one of the Contracting Parties being subjected to the armed attack by any state or several states jointly and thus being involved in a state of war, the other Contracting Party shall immediately render military and other assistance by all means at its disposal.