The player can indeed declare war on any country. They just can’t take territory.
For custom: Just set the proximity slider to 1 so that bots attack neighbors.
There IS a proximity priority, and countries like China do tend to attack neighbors. However, countries like Germany aren’t just gonna kick themselves out of NATO. So they go imperialist and neo-colonize. This is also the “imperialist” tendency in the country settingd tab in Custom.
Limiting the bots to only neighbors is pretty disingenuous IMO.