If you’re just screwing around at low volume it’s probably fine. A bass amp would be better.
Running a bass through a guitar speaker can damage the speaker or sound horrible since the low frequency waves are long and require the speaker head to move farther than treble tones. Bass speakers are designed to handle the low tones. You can probably get away with it at low volume, but better to get something designed for the job.
Running a guitar or uke through a bass speaker is fine.
Nitpicker’s corner: running a bass through a guitar amp head is fine. You’ll emphasize different frequencies, but it’s safe and plenty of great bassists have done so to get their sound. In a combo amp the speaker is the limiter. I’verun my bass through a small guitar amp with headphones with no problem. Using the amp’s speaker rattles like crazy, and it probably would have torn the cone if I kept going.