Configuration for all hosts can be applied to [all:vars]. The same variables in the children group will take priority. For example if you have:
[centos]
centos1 ansible_port=2222
[all:vars]
ansible_port=1234
The priority will be at the port 2222.[centos]
centos1 ansible_port=2222
[ubuntu]
ubuntu[1:3]
[linux:children]
centos
ubuntu
[linux:vars]
ansible_port=1234
In this case - the same the priority will be at the port 2222.