This answer is for dnd-5e
Meld into Stone does not block Body Thief
The Intellect Devourer's Body Thief ability states:
The intellect devourer initiates an Intelligence
contest with an incapacitated humanoid within 5 feet of it. If
it wins the contest, the intellect devourer magically consumes
the target's brain, teleports into the target's skull, and takes
control of the target's body.
There is nothing in there about the devourer needing to see the target, or needing line of effect. Teleportation effects also typcially do not require line of effect. So all that is required is that the devourer is within 5 feet of the target, and the target is humanoid and incapacitated.
Meld into Stone does not give detail on how far into the stone the body is melded, it merely states that you are melding yourself and all the equipment you carry with the stone for the duration, and that You can use your movement to leave the stone where you entered it, which suggests that the melded character for purposes of measuring distances or movement is adjacent to the space where they entered the stone, and would be within 5 feet of the devourer, if the devourer would occupy a space right next to the stone.
However, Meld Into Stone does not incapacitate the caster. It does not say so, and it explicitly says that the caster can cast spells on themselves, which they could not if incapacitated. So it would require some pretty unusual circumstances for the caster to be incapacitated while melded in stone, and when they are not incapacitated, there is little the Intellect Devourer can do to harm them.
Attacking the stone
Well, they could try attacking the stone with their claws: in 5e, stone by default rules has no hardness, only AC and hp (see p. 246 DMG for more details); it would be up to the DM to rule the claws of the devourer are ineffective against it. If they do not rule so, the devourers will eventually damage the stone enough to harm the caster -- the spell says that "Minor physical damage to the stone doesn't harm you, but its partial destruction or a change in its shape (to the extent that you no longer fit within it) expels you and deals 6d6 bludgeoning damage to you."