Dogs, because of their habit of scratching ears with back feet, can occasionally get dirt into a scratch, and it can form an abscess
. Also, in that position (around the ear
/neck area) infection could arise from a collar which has chafed the skin or rubbed dirt in.
Some lumps are made up of fatty tissue.(Lipomas, which are benign, and normally do not need to be removed unless they grow or cause pressure on surrounding tissues.