You don’t get paid just because a video of yours goes viral unless you have enabled monetization on whatever platform you are using. And you may not be able to monetize your account until you’ve reached a certain number of followers.
For example, to join the YouTube Partner Program, you need to have at least 1000 followers. But having your video go viral can greatly impact your number of followers, which in turn can increase your earning opportunities.