An ally can not fight an ally so if any unit is there then you cannot take it. However if your ally does not leave at least one unit there then you can take ownership by just walking into it.
Sometimes an AI ally will take a resource from you. But I figure it happens about as often as it would with human players

It is best to select an ally who does not need the same type of resource as you.
Also, I can actually manipulate an AI ally almost as if it was a human player by deciding which resources to pull my guards off of. Especially allowing him to take a site such as a Castle where he can recruit if that castle is in an area I wish he would concentrate on. (all of this is much easier with a human player of course)