Just going from what i've seen happen so far and what's common to my knowledge:
In Belgium and most countries/top leagues a normal game has 4 officials: 1 referee, 2 assistant referees and 1 extra assistent referee handling the subsitutions, keep coaches in their box,...
The extra assistant referee here in Belgium, at top level at least, is always a normal referee. So if something happens(=injury) to the main referee he is the substitute. He will also be the substitute if something happens to an assistant referee. So they are somewhat interchangeable.
But mostly, referees are more or less fixed trios where everyone has his fixed assignment as either referee or assistant referee. These will not change. The league will then appoint an additional fourth member that has no other game to officiate that day.
As for assistant referees taking over a referee's position, yes it is possible, but not common as in professional games their would have to happen at least 2 injuries before it would be up to one of them. They would also know the rules ofcourse. So they should be able to pick up the role in rare instances. But AFAIK I've not seen it happen. Somewhat the other way around, by means of the extra 'main referee', I have seen happen in both instances. These being replacing a main referee or an assistant referee after them being injured.
So, yes they are. But as you may guess, it won't be optimal as the assistant referee has no/less experience in the main referee's role and the main referee will probably be less trained in offside situations (and is less used to waving a flag instead of blowing his whistle).