Slugs inside hives, of all types, is very common.
The huge black ones, like liquorice, are more commonly found on the outside of the hives, particularly if there is a lot of lush vegetation around, but also inside from time to time. They like algae, slime moulds (barely visible), and possibly hive debris.
Then there are the ones we call 'tiger slugs' perhaps leopard would be more appropriate, which are light to mid brown with blackish spots, streaks, and patches on them. They graze away normally inside the hive. We suspect they possibly have a taste for the propolis varniah, or chalk brood mummies, or general hive debris, though there seems little correlation between their presence and floor cleanliness. They can be present in the hive at any time of year, and if the bees take a particular dislike to them you can find them dessicated on the floor and entombed with propolis.
There are various small slug types too, from plae grey to reddish brown, and those we generally ignore. The big ones we evict.
We also have places where we get a lot of snails on the hive outsides. It is a site specific issue, some places they are a pest because they get into awkward places like under roof edges whilst working, and some other places you get unique looking varieties, sometimes huge, at least an inch and a half across. Again it is linked to vegetation and dampness of the ground. Their reason for being there appear to be either looking for algae on the surfaces or just a nice safe resting place. Under the hives and the roofs may just be a good way to avoid thrushes etc.
Neither the slugs or the snails are anything more than a curiosity and very minor irritation. Never seen any indication that they are after any of the vital parts of the active colony,as in honey, wax, pollen, or live brood.