I've wondered this myself. When I first picked up HK-51 he had aim-based armor, implants, and earpiece but cunning-based weapon and off-hand. As I recall this was the same with Elara Dorne when she joined my trooper's crew. I'm not sure why BioWare makes it confusing. In the end I decided that since HK-51 is an assassin droid and uses a sniper rifle and vibroknife that he should use cunning-based gear, just like the sniper advanced class for Imperial agent uses. My untested theory is that it doesn't matter all that much. As long as you're equipping characters with tech-power based abilities with aim or cunning and and force-power based characters with strength or willpower then you're generally OK. But I haven't verified this is the case. I can tell you that my HK-51 with all cunning gear puts out plenty of damage.
As for M1-4X and the Mandalorian wardroid gear you can make using Cybertech, there are cores, parts, and motors that have have defense/absorb and shield/absorb. I personally view M1-4X as a mitigation tank more than an avoidance tank so before 2.0 hit I think I had him at 10-15% defense, 35% shield and 33-35% absorption. I haven't used M1-4X since 2.0 though so I expect that his defense, shield, and absorption chance percentages have dropped since M1 still has the same gear he did pre-2.0.