You give a sample from your mouth. It is your responsibility to make sure that your mouth does not have any DNA from another person.
As to contamination from the package or in the lab itself, it is highly unlikely though possible. All companies try their best to ensure no contamination.
Most probably, what you have experienced is a faulty or inaccurate interpretation of the test results. Ancestry tests in particular are not 100% accurate.