I don't know about the legality (I'm sure people have done it though), but I recently was in a situation where a Twitter account that I needed was abandoned. Twitter typically does not transfer ownership all too easy, but because I owned the trademark on the phrase (standard character mark - so the words, not a designed logo), they did transfer it to me. Of course this is a situation where all parties were within the US.
Same thing for domain names. There are processes which you can go through to get a domain transferred to you. Unfortunately these processes aren't as easy and can come with a cost for the 3rd party arbitration. However, this could be cheaper than an unreasonable squatter's demands.
So that said, I think lesson learned. If you have something that's important to your business' (or startup's) brand/identity ... Spend the time and $400 (or whatever it is) and get the trademark. It will give you a bit more legal power in many cases. International trademarks of course are more expensive and in this particular scenario it may not have helped much if it weren't for the fact that both Twitter, my trademark, and I were all in the US. It most certainly would not help if it was a domain name squatter in a different country.
The other card you can play is talking to the squatter and saying, "Look, no one is going to buy this domain from you because it's useless to them. I own the trademark and they won't take on that legal risk. So give/sell it to me or hang on to a parked page forever." -- I do not own the domain name for my trademark (not the .com) and the person squatting it does reside in the same country. I've talked to them before and got some weird line about how they were holding on to it for a friend who has a copyright on some project idea, blah blah blah. I may go back and pursue it in the future, but at the end of the day - they literally can not go about starting a product using the name because of my trademark (not without subjecting themselves to legal risk). So I fully heartedly expect that domain to just sit and do nothing, which is ok because it doesn't compete with me like that. It's merely out of the equation. It doesn't appear in Google search. No one can get to it. I don't even believe there is a parked page. In fact, if there was a parked page and the person decided to try to make money off of it, they would be in even hotter water.
Get a trademark when you can.
Better yet, find unique names so that you don't end up in these situations. It's very expensive for startups to be buying handles and domain names. It's not where funding should go. Especially early on when you might not have established an identity yet.