A betta and pygmy corys should do great in a 10g. You could even do slightly more than 8 if you wanted, but it's a safe starting point. I have a betta, 7 Corydoras habrosus (dwarf corys but not actual pygmy corys) and some other fish in a 20 long and they get along fantastically.
I've kept pygmy cories in multiple betta tanks and have never had any issues with the bettas bothering them. Even my more aggressive bettas have totally ignored them. They're a staple in my betta tanks.
My bettas dont mess with my rainbowfish... other bettas, or anything.. esp the females. the males? you just have to make sure you dont introduce them before the others. put the other fish in first then add the bettas so they dont create territory!
any fish with a betta will depends on the betta. i have a male with some guppies and sword tails. but then i have a 2nd male and a female that live alone cause of how mean they can be to other fish. im a big fan of pygmy cories. there are 3 different pygmy cories. what one are you getting. i got pygmause, and have like 18 of them in a planted 10 gal and only see them when they dart from one side of the tank to the other. mine only get to be about 1 inch long as adults. and yes with corries the more the better.
Given the proper amount of space, corydoras and bettas make great tank mates. I've got a few Dwarf Cories (I'm assuming they're different from the pygmies) and they're really active and surprisingly hardy for such small fish. I'm tempted to just have them in my nano tank.