Are you asking if you can write an offer on the house that you intend to purchase,
and write in that offer,
"Contingent upon the Sale of Buyer's Existing House"?
If that is the question, yes you can write it in an Offer.
But don't count on a Seller accepting it.
A Seller that does accept such a contingency will usually want verification that your house is properly Listed for sale at a realistic price.
There will be further time constraints, and possibly you will be offered a First Right of Refusal
("okay, we accept your offer, but we are keeping the house on the market, and if another Buyer comes along,
we will give you 24 or 48 hours to Buy this house, otherwise it goes to the New Buyer").
That is how is USED to be.
In the current Real Estate Market, with rare exceptions, very few Sellers want to take their house off the market.
(When Real Estate Agents see the word "Contingent" in the MLS, they will generally shy away from showing that property).
Best wishes to you,