Yes, you can use a melody from another song. However, you will need the composer's permission first.