Yes. Most beginner Star Wars sets are rated 6+ or 7+, and the popular vehicles (Microfighters, smaller X-wings, AT-ST) are perfect for a seven-year-old.
Which LEGO Harry Potter for a 7-year-old?
Pick smaller Harry Potter sets rated 7+: magical trunks, a compact Chamber of Secrets, classroom scenes. The big Hogwarts castles are 10+ and call for patience.
How many pieces for a 7-year-old?
Ideally 300-700 pieces. That is enough for the build to take 2-4 hours and give a sense of achievement, but not so much that the child abandons the project.