Can you wait and buy it when you arrive? YES
Small padlocks are useful in three main ways; They enable you to securely lock your room where a padlock clasp is provided on the door (quite common), they secure rucksacks against casual thieves, and they enable you to secure items to something solid like a bed frame.
Often your possessions. are at most risk when you are not with them. When you leave a rucksack in a room, whether when you go out all day, or just for a shower, all your traveling possessions. are unguarded.
Security of rucksacks isn't easy because they are made of fabric and are vulnerable to a knife, but most opportunist thieves will look for an easy target- something they can take without leaving an obvious trail.
Locking your room is the most obvious solution, but remember that staff may have keys to your door, and previous room users may have lost keys which are now in other hands. Some resorts do not provide locks on doors - instead they provide a padlock clasp and leave you to provide the padlock. Its a good way to make sure that they, and their staff, cannot be accused of entering your room without permission, but it does mean that you are vulnerable without a padlock of your own.
Your next line of defence is to protect the rucksack itself. Some have loops attached to zips so you can fasten them shut with a little padlock, others don't. Its worth considering this when you buy a new sack.
You can also help stop a rucksack from wandering off by attaching it to something solid- for example a bed frame, small tree trunk or fence railing. Loop the shoulder straps round the back of something and fasten them together through the hasp of a lock.
Choice of lock:
Apart from size you have a choice of a key or a combination. Both have draw backs. Keys can become lost, and you need to find them every time you open or close the lock, and combinations can be forgotten or accidentally altered. For long term safety a key is usually better as a thief in no particular hurry can work through a 4 figure combination lock in a few hours.
Both types can be bought in Ugandan markets, but although branded as internationally known makes, will often be inferior Chinese fakes. Despite this, they work and will offer good protection.
If you prefer to purchase before you leave you will know the quality of the lock, but remember that your security as only a taken effort- a determined thief will cut your rucksack straps or sides to get at your possessions.