Mahāsamādhi in Buddhism? Wikipedia defines Mahāsamādhi as follows:


  Mahāsamādhi (the great and final samādhi) is the act of consciously
  and intentionally leaving one's body. A realized yogi (male) or
  yogini (female) who has attained the state of nirvikalpa samādhi,
  will, at an appropriate time, consciously exit from their body. [...] This is not the same as the physical death that occurs for an unenlightened person. 1


A non-practitioner of Yoga would call this 'dying at will'. 

Is there a similar concept in Buddhism?
miccha-samadhi (wrong/defiled concentration). And to think the mind is in the body is also miccha-samadhi if so perceived.