Adoptions in Scotland at the time John and Henrietta Rennie adopted Samuel Dunn were informal affairs up until 1930. The Adoption of Children (Scotland) Act of 1930 introduced legal adoption. Since then adoptions are typically arranged by charitable organizations or the social work departments of local authorities.
Before 1930 adoptions were arranged on a private basis, between individuals or charitable organizations. We do not know how Samuel Dunn came to John and Henrietta Rennie. Were his parents friends? Did the Rennies work though a charity?