How does the digestive system determine what to absorb [as nutrients] into the bloodstream?
Does the digestive system attempt to digest everything and from everything it receives and how it determines what is nutritious?

Human digestive system is genetically determined and can digest only those substances for which it has digestive enzymes and absorb only those that can be absorbed through the specific "channels" in the intestinal lining. 

Human digestive system can absorb nutrients "from everything" (not literally, though), for example, sugar from raw sugar cane.

Before absorption, complex nutrients (starch, sucrose, lactose, proteins and triglycerides), need to be broken down by the digestive enzymes into simpler nutrients, but some nutrients need no digestion before absorption. The following nutrients can be absorbed in the small intestine:


Water
Monosaccharides: glucose, fructose, galactose...
Fatty acids
Cholesterol
Amino acids
Minerals: calcium, potassium...
Vitamins
Polyphenols, plant sterols and stanols and various other plant-derived nutrients
Sugar alcohols: erythritol, glycerol
Alcohol


Nutrients that are not absorbed in the small intestine:


Sugar alcohols: isomalt, lactitol, maltitol, mannitol, sorbitol, xylitol
Oligosaccharides: raffinose, fructooligosaccharides, etc.
Certain polysaccharides (soluble fiber): beta-glucan, guar gum, etc.


These nutrients travel to the large intestine, where they are broken down (fermented) by normal intestinal bacteria into absorbable nutrients, mainly short-chain fatty acids (SCFAs), and gases.

Can "particles" (e.g., microscopic dirt) pass through to the bloodstream if they are small enough to be absorbed?

There is a countless list of substances that are not nutrients but can be absorbed:


Medicines and other drugs
Certain food additives (preservatives, dyes...)
Toxins (methanol, cyanide...)
Various random substances ("dirt")


And there is another countless list of substances that cannot be absorbed, for example, insoluble fiber, such as cellulose, and certain artificial sweeteners, such as aspartame and steviol glycosides from stevia.

Sources:


Absorption (Nutrients Review)
Chemical Digestion and Absorption: A Closer Look (Lumen Learning)