Yes, and yellow fever is the textbook case. Under international health regulations, countries with yellow fever risk or concern about importing it can require proof of vaccination as an entry condition, and crucially, the requirement often applies not just to where you're from but to where you've been, including transit through an affected country. The proof is the International Certificate of Vaccination or Prophylaxis, the famous yellow card, issued at authorized vaccination centers, and it only becomes valid a set period after vaccination, so this can't be a last-minute fix.
A few other proof requirements exist: meningococcal vaccination for certain pilgrimages, polio proof for travel involving specific countries during outbreak periods, and during exceptional times other requirements appear temporarily.
Keep the yellow card with your passport, not in checked luggage, and consider a photographed backup. If vaccination is medically contraindicated for you, a formal exemption letter from an authorized center is usually accepted, though some countries may impose conditions.