Hi,
Considering you have 2D texture that you are mapping to 3D cube, What are you expecting it to look like? Like you want ceiling that is present in your 2D texture to go automatically to the ceiling of the box and the ground that is present in 2D image to go to the ground in 3D box and windows to front face of cube? In short converting a 2D image to 3D scene automatically? Let me know if I don't understand it correctly :)
Unless we are are projecting this texture from a camera, this mapping is expected which we see in viewport. Even with projection, you will get some stretched out areas.
Regards,
Avi