You don't need to play XY, Legends: Arceus, or any other game to understand Legends: Z-A. It's a bit of an odd one to start out with if someone has never played any Pokémon games before, but it shouldn't be confusing since the game does quite a lot differently and explains everything you'd need to know. It also starts off extremely slow-paced and has a lot of expository dialogue.
The story features a few returning characters and landmarks from XY, but not as many as you might expect, and with major changes—this was actually a prominent criticism from fans who were disappointed that they didn't see much of the Kalos that they were familiar with. On the flip side, this means that someone who plays Z-A first still has a lot of new things to see if they subsequently go back to play XY. The gameplay mechanics introduced in Legends: Arceus are easy to pick up and its story isn't relevant at all save for a few inconsequential references in a side quest area.