When the pilot uses pedal in a fighter like F-18, does the aircraft roll? If so, is it the pilot's job to compensate this roll or the control system compensates it automatically? In other words, is it always necessary to use stick with pedal or the pilot can use pedal without any stick?
Depends on the airplane, but normally there is some roll rate generated by yaw, so, yes, to some degree or another. It's called Roll/Yaw Couple, and sometimes, "secondary effect of controls".
Swept wing airplanes, or airplanes with extreme dihedral angles, will generate pretty hard roll rates from yaw; straight wing airplanes less so.
You would have to find someone with actual F-18 flying time to know how hard it rolls when yawed (hard to say how well the DCS F-18 simulates it), but lets assume it rolls moderately hard with rudder input, and the Fly By Wire system in the plane lets you do it.
If you didn't want it to roll as you yawed it, you would do what you do with most airplanes, apply opposite aileron to prevent the roll, and you'd fly along skewed sideways with, say, left rudder and right aileron. If you just keep the wings level, it will change heading into the yaw, doing a flat turn, and it will take some additional aileron to create an opposite bank angle as well, if you don't want it to turn.
If the plane has a mild roll/yaw couple, as my Pazmany PL-2 has, you can point the nose off to the side with rudder, and it will only slowly roll in the direction of the skid, and you can prevent the roll with a very light aileron input, with a bit of opposite bank included if you didn't want it to change heading.
Just why you would use pedal alone to yaw an F-18 in the first place, that's another question. Pointing the cannon at things that are off-axis?