yeah man that's fine, as long as it's got the same mic input..i've got a lenovo laptop that i do this with as well; on the side there's a mic in thing....
here's a thought if you ever get into serious recording and still direct record:
BEHRINGER: UCG102
they're around 50 bucks..i haven't used this, per say, but i do use this:
BEHRINGER: UCA222
the first one, you plug into the USB port, then plug your guitar right into the box. you can monitor what it sounds like through the little box as you play which is cool! the thing is, this bitrate is much higher than the standard mic in audio cable. i think it records at 48khz which is higher than a mic input on a computer...
the second link, the red 202 box, i use because i mic my amps/drums and i've got an 8 channel mixer. you plug this into the usb port, but then you take RCA out's from your mixer and put it into the ins on the red box and bam, you have higher quality STEREO recording ability. for years before i had this, all my drums were recorded in mono because computers mic in ports are mono, not stereo..therefore, panning didn't do squat, everything was directly center channel. this thing is awesome for stereo drums and really sounds pretty damn good, but i think you have to use it wiht a decent computer with decent memory, as if you're using it with a shitty computer you'll get clicks and pops in the recording (trust me, i record in my basement with an ancient dinosaur of a PC and realized i was getting those clicks, but then i started to use my lenovo laptop and they were gone)
check out youtube for some reviews on that first link; i think that might be catered more to what you're wanting to do..and honestly, just because it's behringer doesn't mean it's 100% crap. i'm not a fan of their stuff either, but for 50 bucks man this thing upped my recording quality so much, as i'm still unwilling to pay ridiculous prices for things like firepods etc