Yes, just not for the President. Sarah Palin defeated the incumbent governor and went on to win in the general election. There’s a few more, but she’s probably the most recognizable example.
Presidents who face serious primary challenges go on to lose the general election. GHWB, Carter, Ford, LBJ, and Truman all lost or dropped out after being primaried despite none of them actually losing their primaries. Not sure how that plays out this time, but I’d recommend registering Republican and voting for Nikki, just in case.