I don't know a highly efficient way to do this, although I'm very certain that there will be. However, the general process for testing a location to see if a defined AABB vs other AABB's could fit without any intersections isn't too difficult.
First, have an AABB defined that you want to use to test if you can teleport to a location (i.e. the size of the unit). Now move that AABB, or create a copy of it, to the desired location you want that unit to teleport to and perform an intersection test with other AABB's in the area. If this returns that no intersections where found you know that you can teleport that unit to that location.
If you have found an intersection, run some tests offset from the desired location in a different direction (i.e. above, below, left and right) to see if there is somewhere nearby to teleport to, although I'm sure there are better ways to do this sort of test. Maybe using some form of binary search like a KD-Tree or QuadTree to perform a fast lookup of other units in the area before doing the AABB intersection tests?
As for if the surface at the desired location is not flat and facing upwards, such as a ramp, or an object that is rotated look into oriented bounding boxes (OBB).
This might be useful: http://www.gamasutra.com/view/feature/131833/when_two_hearts_collide_.php