You can buy tickets on the day however, the line at the entrance is so long I do not recommend it. The best way to get Vatican tickets is online, in advance. If you are not sure about your plans, you can opt for tours with free cancellation up to 24hours before or you can try book online on the day. I only recommend booking on the day if you are ok possibly missing out on the museums: the change of them being booked out it high