Fair questions.
The rules for membership and voting will depend on the party, but usually, parties view nominations as an opportunity to drive up memberships, so the rules are generally pretty open to new members signing up shortly before the meeting.
My understanding is that a member just has to live in the riding and pay the membership fee, and then show up to vote at the nomination meeting. In hotly contested nominations, each candidate’s organisation will be extremely active in signing up members. That’s not a bad proxy for their campaigning ability. It’s very much retail politics.
If a particular candidate is very successful in signing up a lot of new members, even at the last minute, and the new members all turn up and vote at the meeting, there’s not much the riding association can do about it. I imagine they would have a credentials sign-in spot, where each person who wants to vote had to show ID, proof of membership and proof of residency in the riding (but I’ve never personally participated in one, so I’m just relying on recollections of news coverage).
There’s sometimes allegations that a candidate who doesn’t have previous strong ties to a riding has signed up large numbers of “instant” members who have no real ties to the party but only to the candidate.
Perhaps the closest analogue in US politics is the caucus system, but on a smaller scale?