Only if the test is designed to do so. A drug of abuse urine test is designed to only detect drug metabolites and specific ones at that.
Yes, we can detect pregnancy in a urine, but only if we are testing for it. In a urine drug test, we do not look for pregnancy or spices or hairspray. We just look for specific drug metabolites and nothing else.
The answer to your question is yes, IF that is what we have been asked to look for. Otherwise, the answer is no.