This would depend entirely on the law of the country whose nationality you wish to claim. But generally countries only allow you to claim their nationality if you were born there; or if your parents were nationals of that country. There may be additional conditions such as having residence in the country concerned, or giving up any other nationality you have.