It depends totally on your status, and what exactly this collaboration entails. You say “working as a staff under one professor”. If you're on a short-term contract (say, post-doc), then it's probably not okay to do independent research on something completely different. You were hired on a project and it's unlikely that you have any significant time left for something else. On the other hand, if this new collaboration is related to your project and you involve your professor in it, it is okay (and he will welcome this initiative from which everyone involved benefits).
To the above, there are a few exceptions:
- People who just arrived usually have some unfinished business with their previous institution, and they are given a bit more leeway in finishing it: revisions to make to papers on track for publication, conference attendance, etc.
- People who are leaving due to their contract ending have to get involved with other projects to get a new job. They have to go fishing around, and this sometime requires a bit of extra work.
- Finally, if your activity on the side is quite unrelated to your main job, and you manage to do it on your own time without prejudice to your employer, you may do so. Some people write books, some get involved in open source software unrelated to their employment, etc.
If you're working as an longer-term staff researcher in someone's group, then it is expected that they respect your academic freedom. To a reasonable extent, you are free to engage in new collaborations with other people, and not necessarily involve your group leader.