Yes. You can add an Arbiter and a Config Server in the same machine.
Generally, you should avoid setting 2 DB process in the same machine because:
- Its harder to provision/estimate the machine resources for 2 process running simultaneously
- Its usually cheaper to have 2 low-end machines than 1 high-end (horizontal x vertical scaling).
- Some resources can't scale in your environment. E.g: network bandwidth.
However, if you want to share resources only with an Arbiter and Config nodes, since they require much less resources then a Primary node, this configuration is quite good.
The following article shows how you could set up your environment with nice images:
Setup: 3 replica sets
M = Master
S = Slave
A = Arbiter
Configuration: 3 servers
C = Config Server
No letter = mongos
Since this configuration mixes things, you can achieve high availability and sharding using just 3 servers.