In a rectangular glass slab, the emergent ray is parallel to the incident ray but they are not along the same line whereas in a prism the emergent ray is not parallel to the incident ray.
This is because in a glass block the two surfaces at which refraction occurs is parallel to each other.