My goats get on fine with then hens, sheep, llama, and ponies. The young goats live next door to the two piglets.
As to escaping, well, some of mine I can recall as being good at climbing, or getting under fences. The Franks, who are three enormous British Toggenburg goats, can jump normal height fencing ......they just seen hell bent on getting out. Their last owner had the same problem. And our white sanaan billy who is nowhere near as big, can get over a field gate if the fancy takes him.
I have found though,that on the whole, if the goats have company, and plenty of food ,l and adequate fencing, they will stay put.
Its important to remember though, that goats are browsers not grazers, and would prefer bushes and trees to grass. I do think thats why they tend to escape into gardens and eat shrubs!