My understanding is that a "rain check" is a slip of paper given to attendees at a baseball game when the game is "rained out" after the fans have arrived and paid their entry fee but before some point in the game (6 innings) where the "win" would be given to the currently leading team. The slip entitles the holder to attend a later game by the "home team". See, for example, Bloomsburry.
The term "take a rain check" became a metaphor for saying you cannot accept an invitation now but you would like to at a later date. It was further metaphorized to be a semi-polite way to turn down an invitation.
Added: As to what spelling would be used in the UK, that is hard to guess. The term has an American origin, but substituting "cheque" for "check" would not significantly affect the meaning, nor would it surprise most US English speakers (if the person writing "cheque" was from the UK). It's largely a matter of personal preference.