If you have a disability that impairs your concentration, you can get accommodations that require your professors to allow you to sew during class. Without official accommodations, however, it's within the professor's discretion whether or not to permit this (at least in the US). In that case, you'd probably want to email or talk to them beforehand so they don't perceive it as rude. Most will probably understand, and some may not. Without a documented disability, however, you won't have much recourse if they decline. However, it shouldn't be a problem for most, as long as you explain beforehand.
Disclaimer: I'm not a professor