The answer is no, they aren't directly connected.
While both are part of the "My Little Pony" franchise, they are distinct storylines.
* "Twilight's Kingdom" is the culmination of the main show's season 4 arc, dealing with Twilight Sparkle achieving her full potential as an alicorn princess and the fate of Equestria.
* "Rainbow Rocks" is a standalone movie introducing the "Equestria Girls" universe, where the main characters are human versions of the ponies, set in a separate dimension.
However, there are some minor connections that can be made, like:
* The "Rainbow Power" concept: While not directly connected, the "Rainbow Power" used by the Mane 6 in "Twilight's Kingdom" shares a similar name and concept with the "Rainbow Rocks" musical, indicating a general thematic link.
* The "Human" world: The presence of human characters and the "human world" was teased at the end of "Twilight's Kingdom," hinting at the potential for future stories that could bridge the gap between the pony and human worlds.
Ultimately, "Twilight's Kingdom" and "Rainbow Rocks" are treated as separate stories, but they share a common theme of friendship and the importance of accepting others, making them part of a larger, interconnected universe.