Fighting an unlawful detainer action after you've lost title through a trustee's sale is not easy.
If you really want to fight it, you should conduct your discovery early. You would want to obtain the foreclosure file to look for any errors made in the process. Usually it contains copies of the notices. Some notices like the Notice of Default and Notice of Trustee's sale and the Substitution of Trustee must be served by certified mail. Quite frequently you'll find the Substitution was not properly handled, i.e. not properly mailed or executed. An improperly executed Substitution of Trustee voids the trustee's sale. Of course, you want to make sure the 3-day notice to quit has been properly served on you.
Unfortunately you can't litigate broad questions of title in the UD.