Yes you can use a form in a component. However you cannot have the same ID more than once on a page.
That means your javascript needs to be designed differently so that it can find and prepare each of the forms each the way you want. Most often people use custom attributes or classes to identify and select multiple on-page elements in JavaScript.