Following on from what h- said, if you want to get rid of the gunner and the mg, I'd have thought that...
_gunner = gunner _mg
deletevehicle _gunner
deletevehicle _mg
...would work. Though if you do in fact need to move the gunner out before deleting him, I suppose you could get him to do this:
_gunner = gunner _mg
_gunner action ["getout", _mg]
deletevehicle _gunner
deletevehicle _mg
Where I'm a bit hazy with this one though is whether _gunner is still usable when he's no longer in the mg. You could do all this with global variables, i.e. naming the unit you want to be in the mg. In which case the name of the unit is the same whether he's in the mg or not.
It's been a long time since I've done anything like this and I can't easily check what works and what doesn't. I do recall doing something similar to this.