I know infected documents in windows have file extension of .pdf.exe or .jpg.exe . Can you infect a file without changing extension? Is it the same in linux?
Those "infected documents" aren't and never have been documents. They are executable files, just like any other app on your computer. However they appear as documents at first glance on a system which does not show file extensions.
As guiverc pointed out, file extensions usually don't mean much on Linux.
Real infected documents use exploits and weaknesses either in the file format itself or the software that the file is opened with. PDFs can have attachments from which an attack can be launched. A quick Google search yielded this page which explains this attack vector: https://leotindall.com/post/pdf-embedding-attacks/