Generally yes as long as they support the same wireless standard. B is the old one, G is the current and a lot of people have "sorta N". The N's will not work across brands because they are not to a released standard.
Forget B it is out of date, too slow and too unsecure.
Go for a G and anything will work together and with the older B's, but not secure and slower with the B equipemnt.
N will work with B and G also but you won't get the speed advantage so it's wasted money since G is much cheaper.