Yes, there is nothing wrong in acquiring property in such manner. However it would eventually depend on facts of each case i.e. who is paying for the flat, what is to happen of the flat post the death of the parties in whose favour it is to be bought etc.