Yes, in most cases, you can do that. There are times when you can use rabbit cages for keeping a hamster. However, it can only happen if the bars of your rabbit cage has minimum spacing in them. With bars too wide, the hamster can escape easily. However, you can convert a rabbit cage into a hamster by adding a wire mesh into the side walls. However, make sure you are not keeping both rabbits and hamsters in the same cage at the same time. It is because of the security of both.