What did people wear under their dresses or breeches in the 17th century? Well, the most common answer is, nothing. Underwear was a fancy upper class phenomenon.
There are some discoveries showing a form of bra and drawers for women in recent archeological studies in Germany and France, and a mention of drawers in Italy. The common women did not use them in a routine way.
The manufacture of various pieces of clothing was severely limited due to lack of elastic, buttons, zippers or snaps. Almost everything on clothes seemed to be tied.
Women wore a chemise, a thin linen shift, with elbow length sleeves, most often pulled over the head and tied at the neckline.  Over that, were the stays. Most often made from lengths of bone aligned vertically, the stays were connected together with cloth and surrounded the mid-section. They were used to keep the waist pushed in and the breasts pushed up. The stays, or corset, were laced up at the back, which meant that the woman could not dress herself, but, rather, needed another to help. A husband could be quite an asset in the morning!
A man wore very long shirts, which wrapped between the legs and kept him warm under his breeches. As far as Scots go, I have no idea how they kept warm under their kilts!
Both men and women wore knit stockings, most often wool. As trade with Asia increased and access to silk became available, knit stockings as thin as heavy tights in today’s society became a style, but very expensive. Men’s stockings were mid-thigh length, held in place by the breeches which were secured just below the knees with ribbons. Women’s stockings were almost as long, and secured below the knees with ribbons. The extra length was rolled down over the ribbons.
Shoes gradually altered style during the 17th century. At the beginning, leather or cloth shoes, and boots, all had flat soles, with just a little heel. By the middle of the century, high heels and high soles became the rage. These were thought to be practical for walking the muddy roads of towns and villages, few of which had so far been paved. Wooden shoes, not unlike those noted in Dutch culture, were actually common among farmers and country folk in England and American colonies, at that time. Women would, then, have indoor shoes and outdoor shoes.