Yes, you can create extension methods on any type of class you want.
However, your example is not a method but a property and you cannot create extension properties.
The following is valid:
static class FormExtensions{
public static void SetId(this Form form, int someId)
{
// Do something with someId here
}
}
// Call it like this:
Form frm = new Form();
frm.SetId(2);