Can I get an STD if my boyfriend pulls out?

Of COURSE! Yes. Stds can be transmitted by skin-to-skin contact and contact with infected secretions. One can transmit stds even without ejaculating at all, let alone doing so while pulling out. Always practice safe sex - use condoms and protect yourself!