I think only if they are on the same ticket. So Harris can get the cash, otherwise they have to refund it.
https://www.usnews.com/news/national...f-he-drops-out
Since $2,000 is the limit to transfer money between federal campaign committees per election cycle, Ghosh said, the Biden campaign couldn’t legally contribute all of its campaign money to a new candidate.
Instead, “Biden’s campaign would have to offer to refund the money to donors, who could then contribute to the new candidate’s campaign,” or “transfer an unlimited amount to the DNC, which could then spend the money supporting the new presidential nominee, and up to $32.3 million of that spending could be coordinated with the new nominee,” said Ghosh.