The police must obtain consent or prior judicial authorization in order for evidence of the accused’s DNA to be legally obtained.
R. v. Stillman, 1997 CanLII 384 (SCC),
 1 S.C.R. 607. continues to govern the procedure for seizing the accused’s own bodily materials.
Police may dab or swab an accused’s hands incident to arrest to check for gunshot residue or to obtain a sample of blood visible on the accused’s skin
See, for example, R. v. Backhouse (2005), 2005 CanLII 4937 (ON CA), 194 C.C.C. (3d) 1 (Ont. C.A.), at paras. 139-45; R. v. Smyth,  O.J. No. 5527 (QL) (S.C.J.)).
Either of these procedures might enable the police to obtain the accused’s DNA, but the police are not entitled to use them for that purpose.
Similarly, if an accused’s DNA is obtained through a penile swab and the swab was taken without a warrant authorizing such seizure, or the accused’s consent, the accused’s DNA cannot be used for any purpose.
R. v. Saeed,  1 SCR 518, 2016 SCC 24 (CanLII), at para 48.