Mine is HTC One X and I am going to buy a mhl to hdmi adapter in our local store. Can I expect samsung or other random mhl adapters to work on my HTC One X in case Stock adapters are out of stock or too expensive?
Samsung has two types of MHL cable: an 11-pin one for their more recent phones, and a 5-pin one for their older phones. The 5-pin one is standard and will work on non-Samsung phones. The 11-pin one only works on newer Samsung phones.
Third-party manufacturers tend to also sell both kinds, so look at which phones the cable says it is for. If it says it's for Samsung Galaxy S4, or if it's Y-shaped with a second USB output, then it's an 11-pin one and won't work with your phone.
See my other answer on How does MHL work? to learn more about the difference.
Generally its better to get one that matches the brand. However it is the same technology so it MAY work. Ask about the return policy to make sure you can return it in case it doesn't work. You should be fine, though I cant say with 100% certainty.
Be careful - I've tried this this week and was unsuccessful. I bought a Samsung Galaxy S3/4/Note etc mhl cable thinking they were all the same and the micro USB is longer than normal. It wouldn't fit in my Nexus 7 or my HTC One X.
I would recommend not to use the one for Samsung on HTC One--I tried several times both for charging and for using MHL HDMI cable connecting to TV-- the micro USB for Samsung Galaxy S4 and S5 did not smoothly fit into HTC One though they all use micro USB and they all look the same.