Is there a kind of a nut or threaded insert that can be embedded in wood so that it will accept a machine screw?
A standard hex nut (or a square one if available) can be inlet into the surface of a board to accept a machine screw or bolt coming in from the other side.
Normally when face-mounted a hex-shaped hole is made, either by drilling the bulk of the waste out first with a suitable bit1 and then finishing off with a chisel, or entirely by chiselling:
Source: David Boeff.
Square nuts obviously show their advantage here as the recess if much easier to cut out with a chisel. However, when using hex nuts some guides suggest it is better practice not to cut a hexagonal recess for them but instead to drill a hole the spanner size (i.e. the measurement across the flats) and then to force the nut into the hole2.
Note that these are intended to be mounted on the opposite face of a board, otherwise they would simply be pulled free as the screw force is applied.
Where you need to face mount on the front side of a board the solution is often T-nuts, which are hammered or forced into the wood. They won't win any awards for discretion or attractiveness so best used where they can't be seen or on utilitarian pieces:
Note that T-nuts normally sit slightly proud of the surface as at A above, but can be mounted flush where needed by seating into a shallow drilled recess as at B.
Last but not least, threaded inserts:
These are designed to thread into the wood usually but some only have flanges on the outside, not a thread. This type are either forced into a suitably sized hole or epoxied in place. If using epoxy be sure to thoroughly degrease the insert beforehand as they may retain some grease from manufacture.
Threaded inserts can be a bear to install straight, there are various tips to help and one of the standard ones uses a drill press as shown here on Popular Woodworking.
Another way a standard nut can be used is to inset it from the side of a member, basically you cut a shallow (usually stopped) mortise that intersects the pre-drilled hole the screw/bolt will go through. This is used on bed frames and for the leg-to-stretcher joint on some workbenches and large tables or benches with knockdown construction.
Another option here is to use a wing nut:
Source: Popular Woodworking.
For this same kind of mounting a barrel nut can be used instead and being cylindrical they simply slip into a drilled hole:
Barrel nuts tend to be much more expensive than you'd guess so expect some sticker shock.
1 A Forstner is a good choice but a sharp spade/flat bit will do the job. If the spade bit has spurs on the outside edges the bottom of the hole won't be totally flat but it's not a problem.
2 Nuts can be forced in using clamp pressure, a vice or by using the screwing force of the nut and screw themselves. Another method, giving very good accuracy, is to use the drill press much as explained above in the Popular Woodworking link relating to threaded inserts.
Note that forcing nuts in can take considerable pressure, especially on hardwoods obviously, and this can over-stress a standard woodworking vice so caution is advised if you want to do it that way.
There are several kinds of embedded nuts, depending on where and how you want to mount them.
Threaded inserts screw into a drilled hole and have threads on the inside to accept a bolt.
"T nuts" insert into a drilled hole from the back, anchoring themselves in place with a spurred plate that can't be pulled through and resists twisting.
Barrel nuts insert from the side.
There are probably others I'm not thinking of right now. A good woodworking supply store should have most of these in a number of sizes; a good hardware store should at least have some.