If it is in a place where it is not an eysore, but could be readily be inspected if needed (like a beam in a loft/ garage/understairs cupboard etc) then yes it is perfectly OK from a regualtions and safety point of view, but as has been mentioned it is not perhaps the neatest of methods.
If you are happy with the appearance threre is no need to change it, but if you are re-doing it anyway then perhaps a rethink is worth it.
There are also proper 6 terminal JBs available for situations where just a few more terminals are needed than the standard 4 (but don't use the really small ones unless you are a masochist or have the fine finger skills of a watchmaker.)
Otherwise double socket boxes and blanking plates can be used to hold choc-block terminals, and many heating systems are wired that way, (called a wiring centre), usually the terminal strip is fixed to the box with a few M3 countersunk bolts. However, unlsess done well, these substitute one box of spaghetti for a few boxes of simplicity, so may not always be an advantage.