This is definitely possible.
There is an article related to restricting the selection field along with the example code.
I posted the link below so please check it.
Though the article is about restricting the USER SELECTION field,
you will probably just need to alter few stuff for the DEPARTMENT field.
-kintone developert network - Allow only 1 user for User Selection fields
I hope this helps.