A computer is NOT an amplifier. An amplifier is an amplifier. You don't plug a guitar into a mixer and hear sound without an amp, do you?
Are you talking about using the line-in plug? Yes, you can do that but you still have to feed out to a guitar amp. Also, I don't know how onboard sound compares to a sound card how well it handles input.
is it safe to use a computer as an amp for an electric guitar using an interface..
So you are running the guitar into an audio interface then into the PC?
Of course it's safe, provided you don't boost the guitar signal too much before it reaches the PC.
I use a Tascam US-122 but there are hundreds of models that will work.
Without an amp guitars produce a measly little noise that will not harm your computer.
I recommend you download guitar rig to add effects. You can't beat it.