The answer to this may depend upon your healthcare professional and overall health. While some healthcare professionals may allow you to drive yourself to and from a stress test, others may ask that you have someone to drive you home after.
Because you receive medications or perform exercise in a way that stresses your heart, it's hard to predict how you will feel after the test. To travel most safely, have someone drive you home.