You should be able to buy tickets at the ticket office in Basel. You should also be able to buy those at ticket offices elsewhere. If you are travelling from somewhere in Switzerland to Somewhere in France you can just buy a ticket for that at your starting station, and do not need to do it when changing trains in Basel.