Dell OptiPlex?
You need to identify the specific Motherboard you are working with and then refer to the applicable User Manual for supported components and configurations.
For example, based on the following link my answer is no; a 1TB M.2 SSD is not supported.
https://downloads.dell.com/manuals/all-products/esuprt_desktop/esuprt_optiplex_desktop/optiplex-360_service manual_en-us.pdf
However, details matter so go to Dell's website and if I have incorrectly identified the motherboard then look for the correct User Manual. Read the notes and fine print.
Very likely the Dell also has an online listing of supported components that is more up to date. Check that list as well.
Key is the motherboard including version/revision.