It is considered an exploit to build high level barracks then switch to an alterative government and build high level barracks of the other type, but you are well capible of it.

There shouldn't be any additional problems in doing what you ask.