I am a bassist and I am looking for an electric guitar, but I don’t want to buy another amplifier. Can I play the guitar through the bass amplifier?
Bass amps have been used by guitarists for many decades. In some instances, they work better for guitarists than other amps designed for guitars, especially the speakers. If you are going to use effects pedals, they will do just fine, but if you're looking for something that will overdrive and distort, bass amps generally aren't designed with that in mind. If your bass amp is a valve amp, it'll do the job really well. If it is a transistor amp, it'll still work well enough, but you won't really be able to overdrive it as much as you would an amp designed for guitar.
The Fender Bassman has famously been many guitarists' amp of choice over the years. A bass amp still needs to produce all the same higher frequencies as a guitar amp, because it's the higher frequencies which give you the "attack" of a note. So there's no problems with the speaker itself.
As LaurencePayne said already, guitar and bass amps are not intended to have clean, flat responses like a PA amplifier and speaker. Amplifiers are deliberately run into saturation or distortion of various kinds. Speakers are not designed for flat responses. And speaker cabs are pretty much without exception constructed in a shoddy way which would horrify a PA speaker designer, with insufficient bracing all round and no damping or box tuning. But all this is why a guitar or bass amp has a distinct "sound" and a good PA speaker does not.
Where you are likely to have issues though might be with the EQ. A good bass amp will have 5-band EQ, and you can generally make that work. Others may only have 3-band EQ though, or perhaps even just a "tone" control. On a bass amp, that'll be set up for the kind of frequency range which is most applicable for a bass, and it won't necessarily work so well for a guitar. If there are other FX on the amp, they may also be tuned more for a bass.
The obvious solution in that case is to get yourself a pedalboard for the guitar. This works best if your amp has an FX loop, because then you can make best use of the amp's preamp, but otherwise an FX unit or pedalboard which includes an overdrive on the way in will still work fine.
Technically yes, playing electric guitar through a bass amp can be done, nothing will break, no one will get hurt.
I guess the thrust of the question is more, will I get a satisfying sound playing electric guitar through a bass amp?
This is a great question, and there are two distinct parts.
Firstly, the amplifier itself. TBH (and I'm happy to get slammed for saying this) the amp itself will sound fine as the amp isn't the most important part of the signal chain. Controversial I know but check Brian Wampler's vlog on amp Vs cabBut bass amps are designed to handle a fat load without distortion so the results are possibly a bit too clean for some people. But if you play clean or use pedals for colour then this isn't an issue.
But secondly, and in the context of this question (and the video link above) I think more importantly, is the speaker(s) and cabinet. Speakers are often overlooked when we talk about the characteristics of a guitar rig. Go look at a shoot out video putting a pair of blues junior combo amps with contrasting speakers to the test. Same amp, different speakers, the result can be night Vs day.
This is an even bigger consideration in the world of bass when you consider that bass cabs/combos commonly range from 10 to 15inch plus, and guitar speakers tend to be 12inch (not exclusively but very commonly). So if you have a combo with one 15" speaker (a 1x15, or 115) you are going to get a vastly different sound than two 10inch speakers. Big speaker will have less high end, smaller speakers will be give less bass rumble but a tighter sound.
I have recently taken to playing my telecaster through an Orange Bass Terror 500w head in to a 2x10 neodymium bass cab and it sounds so good. It doesn't really do dirty, but I tend to play clean jazzy or country stuff, and I've got pedals for dirt when needed and they sound great too. I might sell my BJ.
The simple answer is of course you can. You won't break the thing. But whether you get a satisfying sound out of it - it really depends of what type of guitar sound you want to use.
It also depends on what type of bass amp you have. I'd argue that since the Fender Bassman's times when guitar and bass amps design were quite similar we had a substantial evolution and divergence of the two. And while Fender Bassman is definitely a guitar friendly animal, modern amps like Gallien Kruger, SWR or Markbass might be less so.
Guitar amps are designed for organic multistage distortion. Some of the most iconic rock sounds involve compound effect of preamp distorition, power amp clipping, transformer saturation and the way a really thin almost paper like speaker membranes of guitar amps color the sound.
One practical solution would be to use the bass amp along with some sort of guitar modelling solution to get a variety of decent sounds.