Notes
No, directly we cannot create master details relationship if custom object contains existing records.
Steps to follow:
- First create field with lookup relationship.
- And then associate look field with parent record for every record
- Next change the data type of the field from look up to Master detail.