USADA the national body will test in USA in Australia it is ASADA who is the body who represent WADA also UCI can test .
Why do they have right to test is because you sign an agreement when you apply for your licence. You also signe an agreement to have all legal issues dealt with CAS so it places these people above the law of your country.
If your sport body dosnt have an agreement or doping policy then they cant test.
for example the veteran cycling movement dont have a doping policy because it is all done by volaunteers and they cant afford testing. in Australia they have a handicap system if you win you go up a grade so Doping dose not work out unless you want to dope and end up in a very hard race situation.