I did once have a machine purchased from a certain 'Mr Cooper' that certainly wouldnt sew a straight line! If you let a piece of fabric go through on its own it would gradually go on a curve - I had a good look at it and the feed dogs were very slightly set crookedly! (Yes, I caught him in decent mood and he changed it straight away!)
However, please don't be harsh on yourself about it, sewing a dead straight line isnt that easy! The best machines for this are the old fashioned straight stitch only, with narrow feed dogs and and a narrow foot. The next best is a machine with a changeable straight stitch plate and straight stitch foot. Otherwise, use the tried and tested method that all the other good souls have mentioned, and just take your time!