If you delete (or, in real terms, remove the last strong reference to) the instance of class A, it will be deallocated. Under ARC, as part of its deallocation, it will remove its strong reference to the instance of class B, which will then be deallocated if nothing else has a strong reference to it.
So, A's dealloc method is called first.
If you're depending on this order of operations to do anything, that is a pretty bad code smell.