Don't know why quite a number of respondents called them Japanese fighting fish. The most commonly seen bettas are the betta splendens species aka Siamese Fighting Fish. Siam or Thailand in modern day is certainly not Japan.
Although the males are the more territorial & aggressive ones, don't underestimate the females who can even beat up males. Females are regarded as being less aggressive and a better chance of co-existing in a community tank but never take it as a given guarantee. Males will definitely attack other males, will attack females if he's not in breeding condition and may also go for other fish in a community tank especially other ananbantoids (eg. gourami, paradise fish) & fish with similiar coloration & finnage. Hence usually males are kept individually in separate tanks. Females will squabble among themselves but can settle down in a small group of about 3 females.
You'll see lots of conflicting reports about betta compatibility with other fishes on the internet. Many people insist there's no problem keeping even male bettas with other fish based on their own experiences. In YA, those who advocate textbook caution are given thumbs down. What people don't realise is that 2 aquarists keeping the same species & even buying them from the same shop may have vastly conflicting experiences. The personality of individual fishes, fishes from different batches, different tank & water conditions could all affect fish behaviour.