Let's say, hypothetically, you try buying a luxury car or expensive jewelry using cash (100 dollar bills in a bag!). Would that be legal? Will IRS or FBI or anybody come knocking on the door asking about origin of that money or its taxes or whatever?
You can purchase any expensive item for cash, if the seller will accept it. In the US and many other jurisdictions, a seller is not required to accept cash, but many will.
In the US and many other jurisdictions banks are required to report large cash deposits to government authorities, to help combat money-laundering, drug-dealing, and tax-evasion. Such a report may trigger an investigation, and during that investigation a person who bought an expensive item for cash may well be asked about the source of the cash. Whether an answer is legally required will depend on the law in the particular place. But even if it is not legally required, refusing to answer such questions may trigger additional investigation.
Would that be legal?
Yes. But it's also legal for the seller to refuse a cash payment.
Will IRS or FBI or anybody come knocking on the door asking about origin of that money or its taxes or whatever?
They certainly can. A transaction over $10,000 must be reported. The FBI or IRS can choose to take action on it, but that depends on the circumstances.
We once bought a car for cash in excess of $10k and the dealership did indeed report it and we had to sign something to this effect. We brought the cash in from a different country and declared it at customs, so we had a clean record (despite having a difficult conversation at customs at the time).