Yes, you can. If you are staying in Basel it is the perfect place for visiting these two countries in Western Europe. In fact, there is a Three Countries Bridge located near Basel. The city is also worth a visit for its museums and the Rhine River, plus you will find lots of attractions within walking distance of each other.