When someone has a cut or surgical incision that results in a "scar", is the scar tissue replacing all 3 layers of the skin (epidermis, dermis, hypodermis)? Or only the first one or two of them?
This depends on how deep was the initial wound, and how that wound healed. There are mainly two ways a wound could heal, either by primary intention (like in surgically closed wounds), or by secondary intention (like in wound left to scar up with the edges not closed properly).
In very well closed wounds that involves all layers of skin, such as primary intention healing following plastic surgery on previously healthy skin, the skin would regenerate all the layers after a long process that could last for 2 years or longer and involves constant life long remodelling of the remaining scar.
In wounds healed by secondary intention, such as following a third degree burn without treatment with skin grafts, there is extensive scaring (mainly consistent of collagen which could be thought of as a filler and adhesive that allows the epithelial skin layer only to grow over it, without renewing the deeper layers). In such cases the scar is large, adherent to underlying tissue, and has only a thin overlying layer of epithelial skin cells. This scar might also be insensate (numb) as a result of superficial nerve injury due to the initial wound.
Most scars are somewhere on the spectrum between the two extremes mentioned above. A badly sutured surgical wound, or a surgical wound that gets infected later, might still heal by secondary intention causing extensive scaring that doesn't replace all the skin layers. A good plastic surgeon might later remove that scar and allow the wound to heal by primary intension to improve the outcome.
If you would like to expand on how wounds heal, here are a couple of links to start you off:
Some of the information contained in this post requires additional references. Please edit to add citations to reliable sources that support the assertions made here. Unsourced material may be disputed or deleted.