You need to find out what numbers are allocated to you from your Service Provider. Just because you have prefixes doesn't mean you own all the combinations of digits that follow the prefix. Either call them or look at your bill.
For example on one of our ranges we have a prefix 01236 62. we only have DDI numbers for 01236 62 8100 - 8181, if you dial 01236 62 8182 the call won't reach this site.
With regards the switch, you can create any number you like and have it as an extension and also have it dial out, however in order to receive incoming calls to that extension you need to:
either make the last few digits of the DDI number, i.e. the same digits the SP is actually sending to your switch (ours only sends us the last 4 digits - Using the example above 8180 is an extension here, with the full DDI being 01236 62 8122)
The other way is by doing some inbound conversion at trunk level to convert an incoming number to the format you need your internal extension to be.
Best Regards
Craig