That's not an apple tree nor a dogwood.
I suspect you have found a common invasive exotic species, one of the pestiferous Buckthorn species - Rhamnus (syn. Frangula) sp.
This genus often displays subopposite arrangement, and typically has small spines at the tips of growth as it ages.