Can all of those 8 PC's surround and attack the enemy creature (following a square 5x5 feet square grid) in one round?
Yes, trivially answered on PHB p.191.
How many members of the [thousand-person] army can attack a single creature at once?
All of them.
Assuming two dimensions, swords, and no movement, you'll get 24 medium attackers.
8 medium creatures with 5' reach surround the medium target.
16 medium creatures with 10' reach surround the medium target. Per your question they can only have swords, but you can also give them the lunging attack maneuver.
That's not much, though. Only one-fortieth of your army...
With movement you can easily get 840 medium attackers.
With movement you're limited to the number of characters that can get to within 10' of the target, pull off a lunging attack, and get back to their starting position. Actually, there's lots more, but these are the ones that are easy to think about.
Obviously it's nice to have a lot of movement, so let's go with Tabaxi monk 18/fighter 2 using its feline agility: 30' (Tabaxi) + 30' (unarmored movement) is 60' walking speed. Feline agility doubles this to 120'. Step of the Wind allows this attacker to Dash in addition to attacking, so that's 240' of movement available. Assume it's all through difficult terrain--other attackers--so movement costs double.
r=1 (squares): 8 attackers, no movement, shortsword attacks.
r=2: 16 attackers, no movement, lunging shortsword attacks.
r=3: 24 attackers, 5' movement each way (costing a total of 20'), lunging
shortsword attack.
r=4: 32 attackers, 10' movement each way (costing a total of 40'), lunging shortsword attack.
r=5: 40 attackers, 15' movement each way (costing a total of 60'), lunging shortsword attack.
[...]
r=14: 112 attackers, 60' movement each way (costing a total of 240'), lunging shortsword attack.
That's a total of 840 attackers.1
But wait, there's more!
That wasn't actually a very efficient use of attackers' motion. You'll note that most ended the round with some movement unused, and some didn't even use any! Let's fix that.
Starting from the inside, let us suppose that the 8 attackers at r=1 used all their movement to go 120' away after attacking. This means that eight attackers from 120' away could come in and take their places. Likewise the 16 attackers at r=2 could use all their movement to go 125' away; 16 attackers from 125' away can swoop in and take those places. The 24 r=3 attackers move 5' in and 5' back as before, then move 110' out; 24 more attackers at 110' range can move all the way in to lunge-attack and end at r=3.
In this manner we can pretty-quickly double the number of attackers who can reach the target, far exceeding your 1000-creature army. (Actually, it's not quite doubling, since our r=14 ring of attackers don't have "buddies.") This works out to 1568 attackers.2
But wait, there's a lot more!
Note that all of the above assumed that all of each attacker's movement was through difficult terrain. But that need not be the case: we could sequence the movement of attackers so as to leave much movement unhampered. Imagine in the scenario above if the innermost four rings of attackers attack first, then clear out to the extent of their movement. Now, when later rings attack their last 10' in and first 10' out are not difficult terrain. This means that r=14 attackers returning to their starting position have 20' unused movement.3 And that r=15 attackers can make it in-and-back! By clearing out r=1-4 first we've made it possible for r=15 to be the outermost ring. Likewise clearing out r=5-8 next will make r=16 the outer limit, clearing r=9-12 pushes the limit to r=17, clearing r=13-16 makes r=18 the outer limit. And we've pushed the number to 2592 attackers.4
But wait, there's a LOT more!
Consider: we haven't even touched various other speed-enhancers. Haste, various Boots of ..., mixing monk and barbarian unarmored movement, &c. See what's the fastest a character can move in one turn? for a primer on why the true answer to this question might be in the millions. All attacking from the horizontal plane.
And then there's the hypothetical third dimension. If our attackers can have burrowing or flying speeds we can extend the above arguments in many directions. Just the two horizontal planes 5' above and below the target will serve to triple the number of attackers (Assuming you can manage base movement while flying/burrowing.) Off the top of my head, fully-utilizing three dimensions is going to roughly square the number of attackers in range!
1 - The attackers within a range \$r\$ of the target cover a square \$2r+1\$ on a side. Thus the number of attackers within \$r\$ of the target equals \$(2r+1)^2 - 1\$ (the target).
2 - We sum up the attackers within \$r=13\$, double that, and add in the \$r=14\$ ring: $$2\times [(2\cdot13+1)^2-1] + (8\cdot14)=1568$$
3 - Obviously, then, the r=14 ring will not return to r=14, but rather to r=16. And another 112 attackers from r=16 can come in, attack, and end up at r=14. This reasoning continues until we find the "true" outermost ring.
4 - as in note 2.