Your consent, or even you being on the website, isn't needed. If enough of your relatives consented, the stalker can have at least a list of your relatives, and try to guess you from there (as the police did in this case)
Not with the police, but they let people who find a related DNA to find them (this is a feature of these websites). Once the police have your DNA, then can find your relatives. You can't control whether your relatives are opted in to this feature or not.