The normal way of securing a toroidal transformer is through the hole in the middle of the toroid, so may not be a good place. Also the transformer generates heat which isn't the best thing in the world for an electrolytic capacitor.
Otherwise go ahead and put the capacitor there, it isn't going to matter a great deal and there is no "electronic" reason why not.
Just be careful when securing the toroidal transformer that you don't create a "shorted turn" . Easy to do if you are not aware of this potential problem. It won't do the transformer any good at all!
Andrew.