What is claimed is:1. A method of wireless communication performed by a user equipment (UE), comprising:determining a device-to-device (D2D) service type to be used by the UE for one or more D2D communications on a sidelink interface based at least in part on information received from a D2D application executing on the UE,wherein the information identifies one or more quality of service parameters associated with the D2D application;determining a slice identifier based at least in part on the D2D service type,wherein the slice identifier corresponds to a resource allocation of the sidelink interface and/or a sidelink channel to be used for the one or more D2D communications,wherein the resource allocation is determined based at least in part on a data structure, stored in a memory of the UE, that maps different resource allocations to corresponding slice identifiers or D2D service type identifiers; andtransmitting an indication of the slice identifier.2. The method of claim 1, wherein the one or more D2D communications include one or more vehicle-to-everything (V2X) communications.3. The method of claim 1, wherein the D2D service type is represented using at least one of an upper layer identifier, a provider service identifier (PSID), or an intelligent transport system application identifier (ITS-AID).4. The method of claim 1, wherein the data structure is pre-configured on the UE or provisioned for the UE.5. The method of claim 1, further comprising communicating using a set of resources of the resource allocation.6. The method of claim 1, wherein the slice identifier indicates at least one of a slice type associated with the D2D service type, a sub-slice type associated with the D2D service type, or a slice instance associated with the D2D service type.7. The method of claim 1, further comprising indicating a requested duration for use of a slice identified by the slice identifier, a requested slice size associated with the slice identifier, or a combination thereof.8. The method of claim 1, wherein the indication of the slice identifier is transmitted in at least one of a non-access stratum (NAS) message over the sidelink interface, a radio resource control (RRC) message to another UE, an RRC message to a base station, or a header of a D2D communication.9. The method of claim 1, wherein the data structure maps different slice identifiers to corresponding D2D service type identifiers.10. The method of claim 1, wherein the D2D service type includes at least one of a location-based service, an intersection assist service, a platooning service, a cooperative adaptive cruise control service, or a sensor sharing service.11. The method of claim 1, wherein the D2D service type is represented by an identifier that is not readable at an access stratum layer, and wherein the slice identifier is readable at the access stratum layer.12. The method of claim 1, wherein the indication of the slice identifier further indicates a permitted quality of service upgrade, a permitted quality of service downgrade, or a quality of service migration path.13. The method of claim 1, wherein the indication of the slice identifier further indicates a capability of the UE.14. A method of wireless communication performed by a first user equipment (UE), comprising:receiving an indication of a slice identifier that identifies a slice type to be used by a second UE,wherein the slice identifier corresponds to a device-to-device (D2D) service type and a resource allocation of a sidelink interface and/or a sidelink channel to be used for one or more D2D communications of the second UE on the sidelink interface,wherein the resource allocation is based at least in part on a data structure, stored in a memory of the second UE, that maps different resource allocations to corresponding slice identifiers or D2D service type identifiers;determining the D2D service type based at least in part on information received from a D2D application executing on the first UE,wherein the information identifies one or more quality of service parameters associated with the D2D application;determining the resource allocation based at least in part on the slice identifier; andpreventing the first UE from using resources indicated by the resource allocation for transmission of communications not associated with the D2D service type.15. The method of claim 14, wherein the one or more D2D communications include one or more vehicle-to-everything (V2X) communications.16. The method of claim 14, wherein the indication is received from at least one of the second UE or a base station.17. The method of claim 14, wherein the data structure is pre-configured on the second UE or provisioned for the second UE.18. The method of claim 14, wherein the resource allocation is determined based at least in part on an indication received from a base station.19. The method of claim 18, wherein the indication received from the base station is received in a radio resource control (RRC) message or a system information block.20. The method of claim 14, wherein the indication of the slice identifier is received in at least one of a non-access stratum (NAS) message over the sidelink interface, a radio resource control (RRC) message from the second UE, an RRC message from a base station, or a header of a D2D communication.21. The method of claim 14, wherein the indication of the slice identifier further indicates a capability of the second UE.22. The method of claim 21, further comprising communicating with the second UE based at least in part on the capability.23. The method of claim 14, wherein the first UE is prevented from using the resources indicated by the resource allocation based at least in part on a rule-based prioritization of slices or slice types, an instruction received from the second UE, or an instruction received from a base station.24. A method of wireless communication performed by a base station, comprising:receiving an indication of a slice identifier that identifies a slice type to be used by a user equipment (UE),wherein the slice identifier corresponds to a device-to-device (D2D) service type and a resource allocation of a sidelink interface and/or a sidelink channel to be used for one or more D2D communications of the UE on the sidelink interface,wherein the resource allocation is based at least in part on a data structure, stored in a memory of the UE, that maps different resource allocations to corresponding slice identifiers or D2D service type identifiers, andwherein the D2D service type is based at least in part on information from a D2D application executing on the UE,wherein the information identifies one or more quality of service parameters associated with the D2D application; andindicating at least one of the slice identifier or the resource allocation to one or more UEs in a coverage area of the base station.25. A user equipment (UE) for wireless communication, comprising:memory; andone or more processors coupled to the memory, the memory and the one or more processors configured to:determine a device-to-device (D2D) service type to be used by the UE for one or more D2D communications on a sidelink interface based at least in part on information received from a D2D application executing on the UE,wherein the information identifies one or more quality of service parameters associated with the D2D application;determine a slice identifier based at least in part on the D2D service type,wherein the slice identifier corresponds to a resource allocation of the sidelink interface and/or a sidelink channel to be used for the one or more D2D communications,wherein the resource allocation is determined based at least in part on a data structure, stored in a memory of the UE, that maps different resource allocations to corresponding slice identifiers or D2D service type identifiers; andtransmit an indication of the slice identifier.26. The UE of claim 25, wherein the one or more D2D communications include one or more vehicle-to-everything (V2X) communications.27. The UE of claim 25, wherein the D2D service type is represented using at least one of an upper layer identifier, a provider service identifier (PSID), or an intelligent transport system application identifier (ITS-AID).28. The UE of claim 25, wherein the one or more processors are further configured to:communicate using a set of resources of the resource allocation.29. The UE of claim 25, wherein the slice identifier indicates at least one of a slice type associated with the D2D service type, a sub-slice type associated with the D2D service type, or a slice instance associated with the D2D service type.30. The UE of claim 25, wherein the one or more processors are further configured to:indicate a requested duration for use of a slice identified by the slice identifier, a requested slice size associated with the slice identifier, or a combination thereof.