No, Ryzom doesn't support real NPC to join teams at the moment.
However, during events important NPC are implemented using modified regular toons by the event team. Those can join teams just like any toon can.
Recently there has been some work on improving the means of controlling NPC used by the event team. NPC alignment to teams/factions/leagues still is far from what a player can do. NPC's friends can still attack them (and get attacked as a result leading to a lot of problems in a mmo context).
If you change the source code you can do anything. It might take some time to change that and make everything else work together with those changes. But if you are planning on making your own game you are looking at a huge task anyway.
However, during events important NPC are implemented using modified regular toons by the event team. Those can join teams just like any toon can.
Recently there has been some work on improving the means of controlling NPC used by the event team. NPC alignment to teams/factions/leagues still is far from what a player can do. NPC's friends can still attack them (and get attacked as a result leading to a lot of problems in a mmo context).
If you change the source code you can do anything. It might take some time to change that and make everything else work together with those changes. But if you are planning on making your own game you are looking at a huge task anyway.