If someone is not authorized to work in the US and they are currently living there, are there any laws being broken if they ship goods back to their home country? For example, if we call the goods "gifts", but they are shipped to the home country, then sold and part of the profit is sent back to the person in the US. Is that legal?
While there is no law against knitting and no law against sending knitted goods back to the old country, doing so for compensation is a form of self-employment (which is a form of employment). Any employment, including self-employment, is subject to visa-type restrictions, as sketched here. You cannot engage in productive labor, except if you have a B-1 visa (business visitor), you can engage in some forms of productive labor for a non-US employer: negotiating a contract, sales presentation, or a short training session. If you have a B-2 visa, all forms of work are forbidden.