Yes, generally. If you entered the United States under the Visa Waiver Program and your ESTA is still valid, you can generally reenter the U.S. after a short visit to Canada or Mexico.
However, readmission depends on your current admission status and inspection at the port of entry, and the final decision is made by CBP.
A short trip to Canada or Mexico does not automatically start a new period of stay, so it is important to check your permitted stay and travel schedule in advance.
For a smoother trip, please apply for ESTA before your departure.