If you go through rescue or shelters, you're not going to know the dog's background as far as breeding, lineage, etc. The most you may be able to find out is limited info on history as far as who may have owned the dog before, how it behaved in that home, whether or not the dog has health problems right now, that sort of thing. If the dog was a stray then there will be very little information, except the dog's condition
right now.
There may be some general behavioral assessment, if the particular shelter or rescue does that sort of thing. But there ARE mistakes there, either because some shelter or rescue personnel don't read dog behavior very well, or that individual dogs may behave differently in a different settings.
There is also sometimes the "halo effect" in behavioral assessments, especially by small private rescues. (Example: "Well yes, he
has bitten four people in the past, in three different past homes ... but he's just misunderstood!!"
) There are even more mistakes in breed guessing, particularly with mixed breeds.
One way around not knowing background is to buy retired show or working dogs rather than go through rescue or shelters. Buying retirees means knowing lineage, breeding, known health issues in the line that may possibly surface in the future, how the dog was cared for as far as vetting and feeding, how it was trained and by what methods, etc. But honestly, you'd be very hard pressed to find any of those retirees for less than $200.