Can I fill this AC line inlet with expanding foam?
You can seal the hole with duct seal.  It is a putty-like substance, which can fill the hole around the pipes.  Duct seal does not harden, so it is easy to remove in the future.  You may have to cut the pipe insulation just short of the hole so you get a good seal.  It may be a good time to replace that whole section of insulation while you're working in the area.   

Duct seal is available at most any home improvement stores.  It's usually in the plumbing or electrical section.