To tame one easily, build one pillar with a ceiling on top of it. Then agro the m3galosaur with now. When it gets close to you place a large hatch frame. This if done correctly will make the m3galosaur only able to run in circles for easy taming.

More Megalosaurus Taming & KO Tips