I found these in my baby lettuce leaf, are they worms? They didn't move and one fell out being stiff
They are leafminers.
They are fly larvae so technically maggots. They are crop pests that do cosmetic damage as they tunnel along the leaf.
There is no fly larva I know of that is poisonous to eat. You can rinse them off, or not. Your remote ancestors would have been delighted to get the extra protein on the miserable lettuce leaf they were eating.
These are probably insect eggs.
Being unmoving, tightly clustered together, and uniform in size, these are most likely insect eggs.
A number of common insects lay oblong yellow eggs similar to those in your image, including ladybugs and cabbage white butterflies. Yours look more like ladybug eggs to me, or perhaps some other kind of beetle egg.