You can put a rug over carpet as long as it is a very long-pile carpet. On top of the long-pile carpet, the rug won’t have enough support and will buckle and wrinkle. It just won’t work right. Any other type of carpet is fine to use a rug on.